User forums > Help
yet another problem with wxwidgets and vctoolkit
Matroc:
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:
--- Code: ---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'
--- End code ---
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:
--- Code: ---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 warnings
--- End code ---
but there's no window.
is there anything important i forgot?
btw this is the prog:
--- Code: ---#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);
}
--- End code ---
Urxae:
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.
Matroc:
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)
Anonymous:
I submitted a bug report for you :)
http://sourceforge.net/tracker/index.php?func=detail&aid=1214819&group_id=126998&atid=707416
Anonymous:
ok, found the prob.
"Enable C++ Exception Handling" needed to be enabled...
Navigation
[0] Message Index
[#] Next page
Go to full version