Author Topic: yet another problem with wxwidgets and vctoolkit  (Read 8559 times)

Matroc

  • Guest
yet another problem with wxwidgets and vctoolkit
« on: June 03, 2005, 11:46:52 pm »
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'
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
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);
}

Offline Urxae

  • Regular
  • ***
  • Posts: 376
yet another problem with wxwidgets and vctoolkit
« Reply #1 on: June 04, 2005, 09:56:23 am »
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

  • Guest
yet another problem with wxwidgets and vctoolkit
« Reply #2 on: June 04, 2005, 12:55:20 pm »
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

  • Guest

Anonymous

  • Guest
yet another problem with wxwidgets and vctoolkit
« Reply #4 on: June 05, 2005, 01:09:44 am »
ok, found the prob.

"Enable C++ Exception Handling" needed to be enabled...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
yet another problem with wxwidgets and vctoolkit
« Reply #5 on: June 05, 2005, 03:43:40 pm »
So, do you have a set of flags that will allow the thing to run properly?

Matroc

  • Guest
yet another problem with wxwidgets and vctoolkit
« Reply #6 on: June 06, 2005, 05:35:47 pm »
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
Code
-D_X86_
-DWIN32
-D_WIN32
-DWINVER=0x0400
-D__WIN95__
-D__WIN32__
-DSTRICT
-D__WXMSW__
-D__WINDOWS__
-DWXUSINGDLL


btw. alowing guests to post sux ;-)

Offline Urxae

  • Regular
  • ***
  • Posts: 376
yet another problem with wxwidgets and vctoolkit
« Reply #7 on: June 06, 2005, 08:34:41 pm »
Quote from: Matroc
btw. 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...