When I compile the shipped minimal sample, it does NOT show the console at startup, but when I write an own application (see code below), the console is shown before the wxFrame is visible. It looks like a wxAppConsole which creates a wxFrame.
Do I have to add a define or something else?
CMakeLists.txt
Code: Select all
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.1)
#add required wxWidgets lib
FIND_PACKAGE(wxWidgets COMPONENTS core base REQUIRED) # it is essential that 'core' is mentioned before 'base'.
INCLUDE(${wxWidgets_USE_FILE})
# build executable
ADD_EXECUTABLE(Minimal minimal.cpp)
# linked libraries
TARGET_LINK_LIBRARIES(Minimal ${wxWidgets_LIBRARIES} )
Code: Select all
#include <wx/wx.h>
class MyApp : public wxApp
{
public:
virtual bool OnInit();
};
class MyFrame : public wxFrame
{
public:
MyFrame(const wxString& title);
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
if ( !wxApp::OnInit() )
return false;
MyFrame *frame = new MyFrame("Minimal wxWidgets App");
frame->Show(true);
return true;
}
MyFrame::MyFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title)
{
}
Code: Select all
cmake -G"MinGW Makefiles"
mingw32-make