User forums > Help

Tutorial Request

<< < (2/2)

rickg22:
The following thread tells you how to compile wxWidgets.

http://www.codeblocks.org/index.php?name=PNphpBB2&file=viewtopic&t=30&highlight=unicode+0

And here's a quote from Mandrav:

--- Quote ---
The way I build wxWidgets is this (assuming wxWidgets sources are in WXDIR):

cd WXDIR\src\msw
mingw32-make -f makefile.g95 FINAL=1 UNICODE=0 WXMAKINGDLL=1

cd ..\..\contrib\src\stc
mingw32-make -f makefile.g95 FINAL=1 UNICODE=0 WXUSINGDLL=1

cd ..\xrc
mingw32-make -f makefile.g95 FINAL=1 UNICODE=0 WXUSINGDLL=1

That's it. Just notice the WXUSINGDLL and WXMAKINGDLL environment vars...

Yiannis.

--- End quote ---


A warning: If due to a misconfiguration (like changing the version of your MINGW), your compilation fails, MAKE SURE you clean out the outputs directory with the following commands:

mingw32-make -f makefile.g95 clean

(do it for wxwidgets, stc and xrc. I had weird linker errors and crashes because I didn't clean up the partial compilations.

Thanks again guys, we need all the help we can get! :)

rickg22:
More on static linking.

There's a problem when linking to wxWidgets statically (this is when we're trying to compile a program with the ALREADY BUILT) wxwidgets library.

But a fellow programmer already solved this riddle (I'm copying from another thread in the forums)

--- Quote ---
Hi.

I had the same problem as you but I managed to solve it Smile Here is how!

The main problem is that the linker doesn't find some librairies it needs in order to link your project.

Usually, when you're linking a wxWidgets app, you need to add this options to the linker (theses options are depending of which wx functions and classes you use, so you perhaps need to add some):
-lwinspool
-lwinmm -lshell32 -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lodbc32
-lwsock32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid

I tried to add this in the "linker options" control (right click on your project, "Build Options"->"Linker options"), but this didn't work.

Instead, add manually the libraires in the "link librairies" box at the left (right click on your project, "Build Options"->"Linker options"). Click on "Add" and go to "C:\Program Files\CodeBlocks\lib" directory (assuming you did a standard installation).

Here there is a lot of files whose name is starting by "lib". Select for exemple libwinspool.a (which corresponds to "-lwinspool" in the command line). Click on ok. Now you can edit the full path of the librairy.
THERE IS A BUG IN CODE::BLOCK 1.0beta6: if there is a space in the name of a librairy, the command line is misinterpreted!!!! (please developpers, add " ou ' before and after each name!!)
So we need to act like 10 years ago: change "Program Files" by "Progra~1". Click finally on ok.

You need to do this for all the librairies you need (sorry). If uyou have undefined symbols, do a search on google: it will give you (generally) the MSDN page corresponding to the function. Here you can find which librairy you need to link.

Evan Meakyl

--- End quote ---


Hope this helps. Now it seems to me that the "project templates" to build programs with the static library, *do not* have these extra libraries included. I guess we have to work on them.

Cheers.

rickg22:
Update: I just added the libraries you mentioned (except the ODBC ones) to the wxwidgets project template (statically linked). IT WORKS! :D

I just hope it gets integrated into the project before beta7 comes out. Cross your fingers! :)

Navigation

[0] Message Index

[*] Previous page

Go to full version