Building wxWidgets with MinGW

Pages: 1234
You may not it there - you will find it here
http://sourceforge.net/projects/boost/files/
You will see boost-jam listed
Last edited on
thanks SO MUCH!! The instructions didnt mention anything about having to download files from another source (other than the boost library...).

EDIT1:

I did it and heres what I got, but I can't seem to set up codeblocks' global variables with it because there is no folder named "stage\lib". Can someone help me? Here is the output of the 'build':

C:\boost\boost_1_47_0>bjam --toolset=gcc "--prefix=C:\CodeBlocks" install
warning: mismatched versions of Boost.Build engine and core
warning: Boost.Build engine (bjam) is 03.1.18
warning: Boost.Build core (at C:/boost/boost_1_47_0/tools/build/v2) is 2011.04-s
vn
C:/boost/boost_1_47_0/tools/build/v2/util\path.jam:476: in path.makedirs
rule MAKEDIR unknown in module path.
C:/boost/boost_1_47_0/tools/build/v2/build\configure.jam:190: in configure.set-l
og-file
C:/boost/boost_1_47_0/tools/build/v2\build-system.jam:725: in load
C:\boost\boost_1_47_0\tools\build\v2/kernel\modules.jam:283: in import
C:\boost\boost_1_47_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
C:\boost\boost_1_47_0\boost-build.jam:17: in module scope


Also, did anyone figure out what's wrong with wxWidgets? I'm out of guesses...
Last edited on
I was waiting for that - )previously I had downloaded just theboost library files for 1.4.7.0) so I got rid of them and tried to build it from source after speaking to you - and received just that error.

I have been been looking at it and found a/the solution.

But I'm out for the next two hours unfortunately - I will post when I get back
and we can go through it.


If you are also having issues building wxwidgets we can go through that as well.


But before I go - what version on mingw are you using - I found issues trying to
build or use wxwidgets with version 4.7 - so I reverted to mingw 4.6.2 - and
had no problems with that version.
also ensure your environment path includes your mingw directory (preferably c:\mingw)
Last edited on
IwishIKnew, I'm stunned that this hasn't worked for you. I'm running windows XP, with MinW Compiler version 3.81. I used wxwidgets 2.8.12.

It took me a long time to put together too. The only variable you need to set is the MingW bin directory. The link below explains the process. They give instructions to compile a DLL version but I changed Shared to 0 for a static library.

http://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW

One big hurdle I had, and I kept getting errors when I tried to compile was that the makefile in wxwidgets had a capital M and I was using a lower case m in the word Makefile.gcc which had me for a fortnight.

I just had another look at the wxWidgets and I now remember something.
I changed the MSDOS command prompt (this is the windows XP command prompt) to C:\wxWidgets-2.8.12\Build\msw . So in the command prompt it was: cd C:\wxWidgets-2.8.12\Build\msw and then I ran the two commands. Once for the Debug build and once for the Release build.

Sorry for giving you the wrong advice before. The msw directory contains the correct Makefile.gcc . I'm bogged down in so many issues right now I can't remember what I did yesterday.


If you're running the same system I am I can't understand why you would need 'boost' but I suppose extra C++ functionality can't hurt.

I understand your frustrations.



Last edited on
OK - I'm back
Let's build WXWidgets 2.8.12.

We should have the path to the mingw executables (mine is c:\mingw\bin) in our environment path.

Open a command prompt window and change directory to the msw sub directory of the build directory.
Mine looks like this:
D:\Programming\Source-codes\wxWidgets-2.8.12\build\msw>


enter the commaned:
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=0 UNICODE=1


The build should start, and if you have explorer open and monitoring the wxwidgets directory - you will see a lib directory appear (if it is not already there) and in that
directory you will see lib (*.a) files and dll files being added as the build continues.

The build may take some time.
if you want a debug build then run the command again but with BUILD=debug

That is it mate...honestly

(Once we have done that, we can compile the boost 1.47 source - that's fairly straight forward as well)
Last edited on
Ok, there must be somthing wrong here.

@dominover
I know, I have been compiling to \msw and surprisingly still keep getting these retarded errors.

@guestgulkan
Sorry, but my computer doesnt seem to agree......

Here are the specs for my computer:

OS: W7
IDE:Codeblocks(10.05)
Compiler: MinGW(2.19.1)
GUI Visual 'Builder': wxWidgets(2.8.12)

Now that I have listed that, I see that mabey MinGW may be out of date... Is that going to be a pain in the ass to build as well? Frankly, going through an installation of MinGW the way I'm going through my installation of wxWidgets isn't a very appealing option right now...

Note: I did get the Code::Blocks+MinGW package, so I basically didn't have to install minGW with codebloacks.

Also, thank you everyone for all of your help. I would never be able to figure this out alone, even with google and bing... Well, mabey, but it may have taken a year, lol. just thank you so much.
Last edited on
Compiler: MinGW(2.19.1)


If you type g++ --version at the command prompt and it said 2.19.1, then it might be too old as you say.

I'll put my hand up and say that I usually don't compile from source -
I download the prebuild Windows installer versions to get things sorted.

Building from source is something I mess about with in my spare time or if I fancy a challenge
(I usually download the sources anyway as I find them useful to learn from)
nvm.

MinGW(4.4.3)

I think that's outdated.
ok, I FINALLY GOT WXWIDGETS TO BUILD! YAAAAAAAAYYYYY!

but wait... theres more!!

I can't seem to get boost 1.47 to build..... -,- after all that hard work, i lose my favorite filesystem library.... :'(

The instructions I'm using don't seem to work, i keep getting errors. It's to the point were I just wrote a damn batch file because I'm sick of re-typing the same monotinous commands over and over to try can build it. If someone could give me the link to instructions on installing the latest version (1.5), or even 1.47 that works, I would thank you so much. I love boost and I really really hate to install wxWidgets, just to lose boost. I did searching and got a lot of forum posts but nothing specific, and the instructional link I did find isn't seeming to work and I can't find instructions on building the latest versionw ith codeblocks. But even so, if anyone can find instructions that work for codeblocks + mingw (latest versions) + wxwidgets, please let me know! I really want to be able to use boost!

The instructions I've been using:

http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef

My specs: MinGW (latest)
WIN7
wxWidgets(2.8.12)
codblocks (10.5)

I'm sorry if it seems like I'm asking you to spoon-feed me, but I can't seem to find any definite answers with a web search, and since I'm not particulary experienced in this 'field', I feel it would be wiser for me to ask people who know more about it than I.

Thank you for your time and effort.
Last edited on
Just out of interest -what did the problem turn out to be ??


With regard to building boost 1.47 from source - open a command prompt
and navigate to boost_1_47_0\tools\build\v2\engine
and see if you have a build.bat file in there.

do build.bat mingw

here is screen dump of what you would expect to happen - (all that stuff you see after you issue that command happend automatically)
D:\Programming\boost_1_47_0\tools\build\v2\engine>dir *.bat
Volume in drive D is DATA
Volume Serial Number is E008-622B

Directory of D:\Programming\boost_1_47_0\tools\build\v2\engine

06/06/2011 16:36 17,755 build.bat
1 File(s) 17,755 bytes
0 Dir(s) 162,487,910,400 bytes free

D:\Programming\boost_1_47_0\tools\build\v2\engine>build.bat mingw
###
### Using 'mingw' toolset.
###

D:\Programming\boost_1_47_0\tools\build\v2\engine>if exist bootstrap rd /S /Q bootstrap

D:\Programming\boost_1_47_0\tools\build\v2\engine>md bootstrap

D:\Programming\boost_1_47_0\tools\build\v2\engine>gcc -DNT -o bootstrap\jam0.exe command.c compile.c debug.c execnt.c expand.c filent.c glob.c hash.c
hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c output.c parse.c pathunix.c regexp.c rules.c scan.c search.c
subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c pwd.c class.c w32_getreg.c native.c modules/set.c modules/path.c modules
/regex.c modules/property-set.c modules/sequence.c modules/order.c

D:\Programming\boost_1_47_0\tools\build\v2\engine>.\bootstrap\jam0 -f build.jam --toolset=mingw "--toolset-root= " clean
...found 1 target...
...updating 1 target...
[DELETE] clean
...updated 1 target...

D:\Programming\boost_1_47_0\tools\build\v2\engine>.\bootstrap\jam0 -f build.jam --toolset=mingw "--toolset-root= "
...found 49 targets...
...updating 2 targets...
[COMPILE] bin.ntx86\b2.exe
[COPY] bin.ntx86\bjam.exe
...updated 2 targets...
D:\Programming\boost_1_47_0\tools\build\v2\engine>


magically after all that, a directory called bin.ntx86 will appear in the engine directory, and in that directory will be two files called b2.exe and bjam.exe

We will call that -phase 1 - see how you go with that.
Last edited on
C:\Users\username\Desktop>set PATH=C:\programmingtools\bjam\boost-jam-3.1.18-1-n
tx86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\PROGRA~1\COMMON~
1\ULEADS~1\MPEG;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Perl\c\bin;C:\Per
l\perl\site\bin;C:\Perl\perl\bin;c:\Program Files\Microsoft SQL Server\100\Tools
\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Inte
l\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files
\QuickTime\QTSystem\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Fi
les\Intel\WirelessCommon\;C:\Program Files\Nmap;C:\programmingtools\MinGW\bin\;


C:\Users\username\Desktop>cd "C:\programmingtools\boost\boost_1_47_0"

C:\programmingtools\boost\boost_1_47_0>bjam --toolset=gcc "--prefix=C:\CodeBlock
s" install
warning: mismatched versions of Boost.Build engine and core
warning: Boost.Build engine (bjam) is 03.1.18
warning: Boost.Build core (at C:/programmingtools/boost/boost_1_47_0/tools/build
/v2) is 2011.04-svn
C:/programmingtools/boost/boost_1_47_0/tools/build/v2/util\path.jam:476: in path
.makedirs
rule MAKEDIR unknown in module path.
C:/programmingtools/boost/boost_1_47_0/tools/build/v2/build\configure.jam:190: i
n configure.set-log-file
C:/programmingtools/boost/boost_1_47_0/tools/build/v2\build-system.jam:725: in l
oad
C:\programmingtools\boost\boost_1_47_0\tools\build\v2/kernel\modules.jam:283: in
import
C:\programmingtools\boost\boost_1_47_0\tools\build\v2\kernel\bootstrap.jam:142:
in boost-build
C:\programmingtools\boost\boost_1_47_0\boost-build.jam:17: in module scope

C:\programmingtools\boost\boost_1_47_0>pause
Press any key to continue . . .


That's what it gives me when I try to install boost using these instructions:

http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef

Last edited on
Also, I'm getting an error when I try to build my GUI project:

C:\programmingtools\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28ud.a(monolib_appbase.o)||In function `wxAppConsole':|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|122|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|122|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|135|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|138|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|122|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|122|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|135|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|138|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28ud.a(monolib_appbase.o)||In function `~wxAppConsole':|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|140|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|140|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|143|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|143|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|140|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|140|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|143|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|143|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|140|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|140|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|143|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|143|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28ud.a(monolib_appbase.o)||In function `_ZN12wxAppConsole10InitializeERiPPw':|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|150|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|150|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|159|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|163|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28ud.a(monolib_appbase.o)||In function `_ZN12wxAppConsole6OnInitEv':|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|175|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|175|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|201|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|201|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28ud.a(monolib_appbase.o)||In function `_ZN12wxAppConsole15OnCmdLineParsedER15wxCmdLineParser':|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|375|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|375|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|377|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|385|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28ud.a(monolib_appbase.o)||In function `_ZN12wxAppConsole17CheckBuildOptionsEPKcS1_':|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|411|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|411|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|430|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|434|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28ud.a(monolib_appbase.o)||In function `_ZN22wxConsoleAppTraitsBase15CreateLogTargetEv':|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|478|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|478|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|479|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|479|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28ud.a(monolib_appbase.o)||In function `_ZN22wxConsoleAppTraitsBase16CreateFontMapperEv':|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|492|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|492|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|493|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|493|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28ud.a(monolib_appbase.o)||In function `_ZN15wxAppTraitsBase16ShowAssertDialogERK8wxString':|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|541|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|541|undefined reference to `__Unwind_SjLj_Register'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|557|undefined reference to `__Unwind_SjLj_Unregister'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|557|undefined reference to `__Unwind_SjLj_Resume'|
C:\programmingtools\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28ud.a(monolib_appbase.o)||In function `_Z10wxOnAssertPKwiPKcS0_S0_':|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|686|undefined reference to `___gxx_personality_sj0'|
C:\programmingtools\wxWidgets-2.8.12\build\msw\..\..\src\common\appbase.cpp|686|undefined reference to `__Unwind_SjLj_Register'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|
Does anyone know how I can fix this???

It seems like one problem after another... after another.... after another... after another...........

@guestgulkan
Also, I found that batch file, and it spit out just what you said it was supposed to. I didnt see anything about that in my online searches, thank you!

It didnt seem to work though:

C:\Users\Username\Desktop\C++\search directory algorithm\dirsearch.h|3|fatal error: boost/filesystem.hpp: No such file or directory|
Last edited on
With regard to the first post about the bjam error - mismatched versions of Boost.Build engine and core
Boost.Build engine (bjam) is 03.1.18

that would happen if you download the bjam file from the internet.

the boost 1.47 source download comes with it's own matching bjam tsource - which you build as I showed in my last post.
oohhhh....

Let me find that bjam folder...

ok:

Bjam is in this directory: C:\programmingtools\boost\boost_1_47_0\tools\build\v2\engine\bin.ntx86

It is building now...
Last edited on
what I did next was to use explorer and copy bjam.exe from that bin.ntx86 folder to the main boost folder which in your case looks like:
C:\programmingtools\boost\boost_1_47_0\

then in the command prompt change back to the main boost folder.
check the bjam version for good measure and it should say something like this:
D:\Programming\boost_1_47_0>bjam --version
Boost.Build 2011.04-svn


It should not say version 3.1. 18.


Now issue the command
D:\Programming\boost_1_47_0>bjam --build-dir=build-here toolset=gcc --build-type=complete stage


Touch wood - the build will start (and if you atre monitoring it in explorer you will see a directory called build-here appear - that is where the build is done - and a directory called stage will also appear).
Hopefully after some time, the the build will complete
and in the stage directory you will find a load of dll files and *.a library files).
Last edited on
Alright, I just discovered that all the god damn files were blocked, so I re-downloaded it (i deleted the zip... -,-), unblocked the zip, and am re-building the thing. I will follow your instructiosn when that has finished.
Alright, it is building now.

I'm still having trouble getting codeblocks to work. Every time I try to compile the simplest program it spits out a billion lines worth of errors... I have no Idea what the heck is wrong with it.
Last edited on
Regarding the codeblocks errors - see if you can copy and post the first few handfull of error lines and the forum
will look into it (maybe start a new thread for it and keep this thread for the boost building job otherwise this thread might get all mixedup and confusing)
Last edited on
@guestgulkan
Alright. I have made a new post specifically for building wxWidgets:

http://www.cplusplus.com/forum/general/82781/

From this post on, it is about Boost.
Pages: 1234