I just installed codeblocks today and tryed to build a basic wxwidgets app.
first i built the wx librarys dinamicaly and tested them with some of the samples, and everything went fine...
but when i created a wx app using codeblocks at first i got tons of linker errors. these where quickly fixed by including the apropriate libs.
then there was a prob with unicode (some _() missing), quickly fixed too, but after fixing this, still there are the folowing warnings:cl : Command line warning D4002 : ignoring unknown option '-pipe'
cl : Command line warning D4002 : ignoring unknown option '-mthreads'
cl : Command line warning D4002 : ignoring unknown option '-fno-pcc-struct-return'
cl : Command line warning D4002 : ignoring unknown option '-fno-rtti'
cl : Command line warning D4002 : ignoring unknown option '-fno-exceptions'I have no idea where these come from...
but i ignored them for now and tried to run the app but just nothing happens.
the console says:Project : wxWidgets application
Compiler : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : C:\Dokumente und Einstellungen\Max\Eigene Dateien\Neuer Ordner (4)\
--------------------------------------------------------------------------------
Executing: "C:\Dokumente und Einstellungen\Max\Eigene Dateien\Neuer Ordner (4)\wxWidgets.exe" (in .)
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warningsbut there's no window.
is there anything important i forgot?
btw this is the prog:#ifndef __BASE_H
#define __BASE_H
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
class MainApp: public wxApp
{
public:
virtual bool OnInit();
};
class MainFrame: public wxFrame
{
public:
MainFrame(const wxString &title, const wxPoint &pos, const wxSize &size);
void OnQuit(wxCommandEvent &event);
private:
DECLARE_EVENT_TABLE()
};
enum
{
ID_MAINWIN_QUIT = wxID_HIGHEST+1
};
#endif
IMPLEMENT_APP(MainApp)
bool MainApp::OnInit()
{
MainFrame *win = new MainFrame(_("Frame"), wxPoint (100, 100),
wxSize(450, 340));
win->Show(TRUE);
SetTopWindow(win);
return TRUE;
}
BEGIN_EVENT_TABLE(MainFrame, wxFrame)
EVT_MENU(ID_MAINWIN_QUIT, MainFrame::OnQuit)
END_EVENT_TABLE()
MainFrame::MainFrame(const wxString &title, const wxPoint &pos, const wxSize &size)
: wxFrame((wxFrame *) NULL, -1, title, pos, size)
{
wxMenu *FileMenu = new wxMenu;
wxMenuBar *MenuBar = new wxMenuBar;
FileMenu->Append(ID_MAINWIN_QUIT, _("&Quit"));
MenuBar->Append(FileMenu, _("&File"));
SetMenuBar(MenuBar);
CreateStatusBar(2);
SetStatusText(_("Hello World!"));
}
void MainFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
Close(TRUE);
}
Those options it doesn't recognize are options for GCC, while you are using Microsoft Visual C++ Toolkit 2003. This is bad ;)
The problem here is, that the default templates were created for GCC. Therefore, they contain GCC command-line options. To remove them, right-click your project, go to build options, and clear those options from the textbox in the lower left ("More options:").
Unfortunately, I can't help you with translating those options to their MSVC equivalents, as I don't know MSVC. But try without them first, see what happens.
Maybe Rick or Yiannis can come by and explain why those options are there, and if those options are needed for MSVC/what their equivalents are.
ok, it compiles now without any warnings
but still no window visible :-/
/edit
i just noticed there seems to be a window created(if i also delete the gnuwin32 option), but its closed immediately (it pops into the taskbar for an eyeblink)
I submitted a bug report for you :)
http://sourceforge.net/tracker/index.php?func=detail&aid=1214819&group_id=126998&atid=707416
ok, found the prob.
"Enable C++ Exception Handling" needed to be enabled...
So, do you have a set of flags that will allow the thing to run properly?
i only removed the flags it complained about and one flag i dont remember (that contained anything about gnu stuff that im not using for this build) resulting in-D_X86_
-DWIN32
-D_WIN32
-DWINVER=0x0400
-D__WIN95__
-D__WIN32__
-DSTRICT
-D__WXMSW__
-D__WINDOWS__
-DWXUSINGDLL
btw. alowing guests to post sux ;-)
Quote from: Matrocbtw. alowing guests to post sux ;-)
Indeed it does. I just posted without realizing I wasn't logged in. Not allowing that would've prevented it.
Oh, and it's confusing as well when multiple guests partake in a conversation, of course :).
*checks if he's logged in this time* good, good...