DavidHart wrote:So you're using the sample code from
http://docs.wxwidgets.org/trunk/overvie ... world.html rather than samples/minimal. I just built and tested that in a 16.04 virtualbox guest. It runs fine. Now you need to do the same thing: instead of (ab)using your CodeLite workspace, open a terminal in some suitable directory, touch HelloWorld.cpp, open it in an editor, and paste the sample code from the website. Then do:
g++ -g HelloWorld.cpp $(wx-config --cxxflags --libs) -o hello
and run it:
./hello
If that gives you the same problem then there's a problem with either your ubuntu or your wx installation.
I expect it will work fine, in which case change the code in HelloWorld.cpp to the code you just posted here. Build it in the same way. If that runs OK, you must have a problem with your CodeLite project settings; in which case, check very carefully that you don't have anything hardwired to the 14.04 box.
If you can't see anything wrong, please post your failing project settings.
OK, So I ran the hello world program perfectly fine. I copied and pasted the code in a different file and in the terminal, I ran the g++ command in terminal, everything was fine.
I then ran this code in a seperate file:
Code: Select all
#include <wx/wx.h>
#include <wx/aboutdlg.h>
#include <wx/stdpaths.h>
#include <wx/listbox.h>
#include <wx/sizer.h>
// For documenting code, see: https://www.stack.nl/~dimitri/doxygen/manual/docblocks.html
class OmniFEMApp : public wxApp
{
private:
wxSize minSize = wxSize(450, 340);
public:
virtual bool OnInit();
};
/*! \class OmniFEMMainFrame
* \brief The main class for everything
*
* This class is also the presentation layer of the main frame
*/
class OmniFEMMainFrame : public wxFrame
{
public:
OmniFEMMainFrame(const wxString &title, const wxPoint &pos, const wxSize &size);
private:
/************
* Variables *
*************/
//! Stores the client size of the main window in the x direction
int clientSizeWidth;
//! Stores the client size of the main window in the y direction
int clientSizeLength;
//! The menu bar for the main window
wxMenuBar *menuBar = new wxMenuBar;
wxBoxSizer *groupOneSizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *vertBoxSizer = new wxBoxSizer(wxVERTICAL);
//! This would be the file menu in the menu bar
wxMenu *menuFile = new wxMenu;
//! This would be the edit menu in the menu bar
wxMenu *menuEdit = new wxMenu;
//! This would be the view menu in the menu bar
wxMenu *menuView = new wxMenu;
//! This would be the problem menu in the menu bar
wxMenu *menuProblem = new wxMenu;
//! The Grid menu in the menu bar
wxMenu *menuGrid = new wxMenu;
//! The properties menu in the menu bar
wxMenu *menuProperties = new wxMenu;
//! This would be the mesh menu in the menu bar
wxMenu *menuMesh = new wxMenu;
//! This is the menu entry for hte analsis
wxMenu *analysisMenu = new wxMenu;
//! This would be the help menu in the menu ba#include <wx/wx.h>
wxMenu *menuHelp = new wxMenu;
//! This is the object for the toolbar of the main window
wxToolBar *mainFrameToolBar = new wxToolBar();
};
bool OmniFEMApp::OnInit()
{
OmniFEMMainFrame *frame = new OmniFEMMainFrame("Omni-FEM", wxPoint(50, 50), minSize);
frame->Show(true);
return true;
}
/****************************
* Function Implementations *
****************************/
OmniFEMMainFrame::OmniFEMMainFrame(const wxString &title, const wxPoint &pos, const wxSize &size) : wxFrame(NULL, wxID_ANY, title, pos, size)
{
/* This creates the main menu Bar at the top */
menuBar->Append(menuFile, "&File");
menuBar->Append(menuEdit, "&Edit");
menuBar->Append(menuView, "&View");
menuBar->Append(menuGrid, "&Grid");
menuBar->Append(menuProperties, "&Properties");
menuBar->Append(menuMesh, "&Mesh");
menuBar->Append(analysisMenu, "&Analysis");
menuBar->Append(menuHelp, "&Help");
/* Creating the menu listing of File menu */
menuFile->Append(wxID_ANY, "&New\tCtrl-N");
menuFile->Append(wxID_ANY, "&Save\tCtrl-S");
menuFile->Append(wxID_ANY, "&Save As");
menuFile->Append(wxID_ANY, "&Open");
menuFile->AppendSeparator();
menuFile->Append(wxID_EXIT);
/* Creating the menu listinging of the Edit Menu */
menuEdit->Append(wxID_ANY, "&Undo");
menuEdit->Append(wxID_ANY, "&Copy");
menuEdit->Append(wxID_ANY, "&Delete");
menuEdit->Append(wxID_ANY, "&Move");
menuEdit->Append(wxID_ANY, "&Scale");
menuEdit->Append(wxID_ANY, "&Mirror");
menuEdit->Append(wxID_ANY, "&Create Radius");
menuEdit->Append(wxID_ANY, "&Create Open Boundary");
menuEdit->AppendSeparator();
menuEdit->Append(wxID_ANY, "&Preferences\tCtrl-P");
/* Creting the menu listing of the View Menu */
menuView->Append(wxID_ANY, "&Zoom In");
menuView->Append(wxID_ANY, "&Zoom Out");
menuView->Append(wxID_ANY, "&Zoom Window");
menuView->AppendSeparator();
menuView->Append(wxID_ANY, "&Show Block Name");
menuView->Append(wxID_ANY, "&Show Orphans");
menuView->AppendSeparator();
menuView->Append(wxID_ANY, "&Status Bar");
menuView->Append(wxID_ANY, "&Lua Console");
/* Create hte menu listing for the grid menu option */
menuGrid->Append(wxID_ANY, "&Display Grid");
menuGrid->Append(wxID_ANY, "&Snap to Grid");
menuGrid->Append(wxID_ANY, "&Set Grid Preferences");
/* Create the menu listing for the properties option */
menuProperties->Append(wxID_ANY, "&Materials\tCtrl-M");
menuProperties->Append(wxID_ANY, "&Boundary Conditions\tCtrl-B");
menuProperties->Append(wxID_ANY, "&Nodal Properties");
menuProperties->Append(wxID_ANY, "&Circuits/Conductors");
menuProperties->Append(wxID_ANY, "&Exterior Region");
menuProperties->AppendSeparator();
menuProperties->Append(wxID_ANY, "&Materials Library\tCtrl-L");
/* Create the menu listing for the mesh menu */
menuMesh->Append(wxID_ANY, "&Create Mesh");
menuMesh->Append(wxID_ANY, "&Show Mesh");
menuMesh->Append(wxID_ANY, "&Delete Mesh");
/* Creating the listinf of the Analysis menu */
analysisMenu->Append(wxID_ANY, "Analyze");
analysisMenu->Append(wxID_ANY, "View Results");
/* Creates the menu listing of the help menu */
menuHelp->Append(wxID_ANY, "View Manual");
menuHelp->AppendSeparator();
menuHelp->Append(wxID_ANY, "License");
menuHelp->Append(wxID_ABOUT);
/* Create and display the menu bar */
SetMenuBar(menuBar);
CreateStatusBar();
SetStatusText("Omni-FEM Simulator");
}
wxIMPLEMENT_APP(OmniFEMApp);// This is where int main is located inside of
Everything again ran fine. Both testes were done outside the codelite environment. I am believing that there is something wrong with the codeLite settings.