follow my heart...
分类: C/C++
2006-08-24 10:01:04
If you didn't install MingW yourself you have to make sure you have the right version of make. Open the command prompt and type:
mingw32-make -v
If the version is 3.80 or greater it is allright to go on, else you have to install the new make.
Now it is time to compile wxWidgets, open the command promt and change to the wxWidgets directory:
cd\build\msw
NOTE: The following directions do not work with msys, or other forms of Unix on windows.
Regaurding warning: type attributes are honored only at type definition:
the warnings are because the makefile turned all warnings on... you can easily edit it at ur wishes -lowjoel (Moderator wxWidgets forum)
Now we are on the right place we are first going to clean up the source:
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 clean
NOTE: make sure you use the same options to clean that you
use for the build step below. the clean target uses these environment
variables and only cleans that version of the generated object and
library files (so it will actually not clean the intended files if
these variables are not present)
NOTE: if you still have
problems with compiling after cleaning, you may want to remove the
directory in the build\msw directory. (it contains object files...)
When everything is clean we can compile wxWidgets:
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0
NOTE: these options are the official Code::Blocks options. When you want another version of wxWidgets (unicode or debug) you have to make sure you build a MONOLITHIC version. (One big dll) Now you can get a cup of coffee, or do something else, because this could take a long time.
When compilation is finished it is usefull to copy the libs to another directory. By doing this you can make several builds (e.g. debug and release).
NOTE: Make sure you everything is removed from the directory
Everything is done now, and we can start compiling Code::Blocks,
couldn't we? No! First we have to setup the paths. Open the codeblocks
project (CodeBlocks-wx2.6.0.cbp) and go to the Build options. From
there you have to go to the tab Directories and Compiler. Here you have
to add the following paths (Remember to replace
The first path is used to find the right setup.h for the build you are using. The other two are for the normal include files.
Now go to the Linker tab and add the following path:
NOTE: You have to replace this with the directory of your own choice in the previous section!
Finally, go to the resource tab and add the following path (Remember to replace
Now you are finished with the configuration and you can hit the compile button (CTRL-F9). Be aware that Code::Blocks does not officially support wxWidgets 2.6.1 so it is possible that new files are not yet in the project. You have to do this by yourself.