User forums > Help

How to build wxwidgets-2.6.3 to work with code::blocks

<< < (3/6) > >>

mandrav:
Try a recent nightly build (today's or yesterday's). One of the changes is the re-designed new project wizard which makes it so much easier to create a *valid* (i.e. with all the correct settings) wxWidgets app.

wittend:

--- Quote from: mandrav on July 05, 2006, 07:58:05 pm ---Try a recent nightly build (today's or yesterday's). One of the changes is the re-designed new project wizard which makes it so much easier to create a *valid* (i.e. with all the correct settings) wxWidgets app.

--- End quote ---

Thanks.

I also had no Idea that there was a patch 2 available for wxWidgets.

Yes, its getting the settings right that is the key.  I see *so* many messages from people struggling with this. Which should be global, which project specific, which include folders will automatically end up with subolders appended by the build process, and why above all things does wxWidgets bury the critical setup.h include in a folder under lib?? 

I am glad that active development is proceeding so vigorously, but when a project is marked release candidate 2 shouldn't the project be feature-complete and all but the most subtle bugs have been squashed?

wittend:

--- Quote from: Michael on July 05, 2006, 07:34:20 pm ---Hello,

If I were you, I would:

1) Update and re-build wxWidgets with Patch 2 if you are still using a version with Patch 1.

--- End quote ---

I did this...


--- Quote ---
2) Update C::B to the latest revision (nightly build or build by yourself).

--- End quote ---

Did this...


--- Quote ---
3) Instead of using a template, try to generate a new project and set coorectly the include and lib directory (also set correctly the type of application you are developing, e.g., dll).

--- End quote ---

But this last is pretty unclear to me.  Generate using a template?  Write a project from scratch, using some other editor?  And use what as a guide to specifying the 'correct' include and lib directories?  All I have is settings that I *know* don't work, and I have a *lot* of them to choose from.  I will do my best to do something like this, but for now I have lost another workday on this project.


--- Quote ---Best wishes,
Michael

PS.: Search also in the forum. I am quite sure that you will find some useful info.


--- End quote ---

Did that too - lots of lost souls out there...

So here is what my ultra trivial code says now when I build it.  In fact, the build doesn't report an error, It just acan't find an executable to run.

-- Dave

-------------- Build: default in test ---------------
mingw32-g++.exe -LD:\bin\wxWidgets-2.6.3\lib\gcc_dll -LD:\bin\wxWidgets-2.6.3\lib -LD:\bin\CodeBlocks\lib -LD:\bin\wxWidgets-2.6.3\lib  -o TEST.exe .objs\main.o    D:\bin\wxWidgets-2.6.3\lib\libwx_mswu-2.6.dll.a  -mwindows
Info: resolving wxStringBase::npos       by linking to __imp___ZN12wxStringBase4nposE (auto-import)
Info: resolving wxAppConsole::ms_appInstance        by linking to __imp___ZN12wxAppConsole14ms_appInstanceE (auto-import)
Info: resolving wxFrame::sm_eventTable       by linking to __imp___ZN7wxFrame13sm_eventTableE (auto-import)
Info: resolving _wxFrameNameStr by linking to __imp__wxFrameNameStr (auto-import)
Info: resolving _wxDefaultSize by linking to __imp__wxDefaultSize (auto-import)
Info: resolving _wxDefaultPosition by linking to __imp__wxDefaultPosition (auto-import)
Info: resolving _wxStatusLineNameStr by linking to __imp__wxStatusLineNameStr (auto-import)
Info: resolving vtable for wxMenuby linking to __imp___ZTV6wxMenu (auto-import)
Info: resolving vtable for wxMenuBaseby linking to __imp___ZTV10wxMenuBase (auto-import)
Info: resolving vtable for wxListBaseby linking to __imp___ZTV10wxListBase (auto-import)
Info: resolving vtable for wxObjectby linking to __imp___ZTV8wxObject (auto-import)
Info: resolving _wxEmptyString by linking to __imp__wxEmptyString (auto-import)
Info: resolving vtable for wxFrameby linking to __imp___ZTV7wxFrame (auto-import)
Info: resolving _wxEVT_COMMAND_MENU_SELECTED by linking to __imp__wxEVT_COMMAND_MENU_SELECTED (auto-import)
Info: resolving _wxEVT_NULL by linking to __imp__wxEVT_NULL (auto-import)
Info: resolving wxAppConsole::ms_appInitFn        by linking to __imp___ZN12wxAppConsole12ms_appInitFnE (auto-import)
Info: resolving vtable for wxwxMenuItemListNodeby linking to __imp___ZTV20wxwxMenuItemListNode (auto-import)
Info: resolving _wxTopLevelWindows by linking to __imp__wxTopLevelWindows (auto-import)
.objs\main.o:main.cpp:(.text$_ZN6wxMenuC1ERK8wxStringl[wxMenu::wxMenu(wxString const&, long)]+0x5a): variable 'vtable for wxMenu' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN10wxMenuBaseC2ERK8wxStringl[wxMenuBase::wxMenuBase(wxString const&, long)]+0x4c): variable 'vtable for wxMenuBase' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN10wxListBaseC2E9wxKeyType[wxListBase::wxListBase(wxKeyType)]+0x45): variable 'vtable for wxListBase' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN8wxObjectD2Ev[wxObject::~wxObject()]+0xb): variable 'vtable for wxObject' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN8wxObjectC2Ev[wxObject::wxObject()]+0x8): variable 'vtable for wxObject' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN7wxFrameC2EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&)]+0x4c): variable 'vtable for wxFrame' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN20wxwxMenuItemListNodeC1EP10wxListBasePS_S2_P10wxMenuItemRK9wxListKey[wxwxMenuItemListNode::wxwxMenuItemListNode(wxListBase*, wxwxMenuItemListNode*, wxwxMenuItemListNode*, wxMenuItem*, wxListKey const&)]+0x39): variable 'vtable for wxwxMenuItemListNode' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x138): undefined reference to `wxWindow::RegisterHotKey(int, int, int)'
.objs\main.o:main.cpp:(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x13c): undefined reference to `wxWindow::UnregisterHotKey(int)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 

Ceniza:
Could you check if you have in the list of defines for your project WXUSINGDLL?

If it's not there add it and rebuild your project.

Michael:

--- Quote from: wittend on July 05, 2006, 09:05:44 pm ---
--- Quote from: Michael on July 05, 2006, 07:34:20 pm ---3) Instead of using a template, try to generate a new project and set coorectly the include and lib directory (also set correctly the type of application you are developing, e.g., dll).

--- End quote ---

But this last is pretty unclear to me.  Generate using a template?  Write a project from scratch, using some other editor?  And use what as a guide to specifying the 'correct' include and lib directories?  All I have is settings that I *know* don't work, and I have a *lot* of them to choose from.  I will do my best to do something like this, but for now I have lost another workday on this project.

--- End quote ---

Sorry to not have been very clear. I just meant to create an empty project and then add the include and libs directories, the libraries and whatever you need instead of using a template.


--- Quote from: wittend on July 05, 2006, 09:05:44 pm ---So here is what my ultra trivial code says now when I build it.  In fact, the build doesn't report an error, It just acan't find an executable to run.

-------------- Build: default in test ---------------
mingw32-g++.exe -LD:\bin\wxWidgets-2.6.3\lib\gcc_dll -LD:\bin\wxWidgets-2.6.3\lib -LD:\bin\CodeBlocks\lib -LD:\bin\wxWidgets-2.6.3\lib  -o TEST.exe .objs\main.o    D:\bin\wxWidgets-2.6.3\lib\libwx_mswu-2.6.dll.a  -mwindows
Info: resolving wxStringBase::npos       by linking to __imp___ZN12wxStringBase4nposE (auto-import)
Info: resolving wxAppConsole::ms_appInstance        by linking to __imp___ZN12wxAppConsole14ms_appInstanceE (auto-import)
Info: resolving wxFrame::sm_eventTable       by linking to __imp___ZN7wxFrame13sm_eventTableE (auto-import)
Info: resolving _wxFrameNameStr by linking to __imp__wxFrameNameStr (auto-import)
Info: resolving _wxDefaultSize by linking to __imp__wxDefaultSize (auto-import)
Info: resolving _wxDefaultPosition by linking to __imp__wxDefaultPosition (auto-import)
Info: resolving _wxStatusLineNameStr by linking to __imp__wxStatusLineNameStr (auto-import)
Info: resolving vtable for wxMenuby linking to __imp___ZTV6wxMenu (auto-import)
Info: resolving vtable for wxMenuBaseby linking to __imp___ZTV10wxMenuBase (auto-import)
Info: resolving vtable for wxListBaseby linking to __imp___ZTV10wxListBase (auto-import)
Info: resolving vtable for wxObjectby linking to __imp___ZTV8wxObject (auto-import)
Info: resolving _wxEmptyString by linking to __imp__wxEmptyString (auto-import)
Info: resolving vtable for wxFrameby linking to __imp___ZTV7wxFrame (auto-import)
Info: resolving _wxEVT_COMMAND_MENU_SELECTED by linking to __imp__wxEVT_COMMAND_MENU_SELECTED (auto-import)
Info: resolving _wxEVT_NULL by linking to __imp__wxEVT_NULL (auto-import)
Info: resolving wxAppConsole::ms_appInitFn        by linking to __imp___ZN12wxAppConsole12ms_appInitFnE (auto-import)
Info: resolving vtable for wxwxMenuItemListNodeby linking to __imp___ZTV20wxwxMenuItemListNode (auto-import)
Info: resolving _wxTopLevelWindows by linking to __imp__wxTopLevelWindows (auto-import)
.objs\main.o:main.cpp:(.text$_ZN6wxMenuC1ERK8wxStringl[wxMenu::wxMenu(wxString const&, long)]+0x5a): variable 'vtable for wxMenu' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN10wxMenuBaseC2ERK8wxStringl[wxMenuBase::wxMenuBase(wxString const&, long)]+0x4c): variable 'vtable for wxMenuBase' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN10wxListBaseC2E9wxKeyType[wxListBase::wxListBase(wxKeyType)]+0x45): variable 'vtable for wxListBase' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN8wxObjectD2Ev[wxObject::~wxObject()]+0xb): variable 'vtable for wxObject' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN8wxObjectC2Ev[wxObject::wxObject()]+0x8): variable 'vtable for wxObject' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN7wxFrameC2EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&)]+0x4c): variable 'vtable for wxFrame' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN20wxwxMenuItemListNodeC1EP10wxListBasePS_S2_P10wxMenuItemRK9wxListKey[wxwxMenuItemListNode::wxwxMenuItemListNode(wxListBase*, wxwxMenuItemListNode*, wxwxMenuItemListNode*, wxMenuItem*, wxListKey const&)]+0x39): variable 'vtable for wxwxMenuItemListNode' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x138): undefined reference to `wxWindow::RegisterHotKey(int, int, int)'
.objs\main.o:main.cpp:(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x13c): undefined reference to `wxWindow::UnregisterHotKey(int)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

--- End quote ---

I have given a try to the wxWidgets template (Windows XP SP2, rev2689 built with GCC 3.4.5, wxWidgets 2.6.3 Patch 2 built with GCC 4.0.3, GCC 3.4.5) and it works fine. It builds without errors and warning and runs fine.

May be the problems you have are not with C::B or the template, but e.g., with your wxWidgets or others.

Patch 2 for wxWidgets 2.6.3 can be found here.

Best wishes,
Michael

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version