For almost three days now I have been trying to get the boost libs working properly in CodeBlocks using mingw. In between many of the problems that I managed to fix by myself, now I'm stuck and it's driving me mad.
I have built the library many many times with different flags sent to bjam but every time I use these libs in CodeBlocks I get the same result. A lot of lines with
undefined reference to `___gxx_personality_sj0'
undefined reference to `__Unwind_SjLj_Register'
undefined reference to `__Unwind_SjLj_Resume'
undefined reference to `__Unwind_SjLj_Unregister'
Before people start lashing out at me, I have searched for the problem before coming here. Almost all the threads (here and here and others) say that this problem comes from the fact that boost was built with a compiler and now I am trying to use another different compiler in CodeBlocks. I have checked time and time again and I only have one MinGW installation available. I have checked my Path variable and nothing unwanted is in there, only the bin folder of the MinGW that I want to use. I don`t have any QT installation so no second MinGW from there. Also, I downloaded the CodeBlocks without the bundled MinGW.
Below I will list the steps I take:
1) bootstrap.bat mingw which builds bjam
2) bjam --toolset=gcc "--prefix=<installpath>" install as stated here
3) follow the rest of the steps from the link from step 2)
4) add Boost.Filesystem, Boost.System, Boost.DateTime, Boost.Thread and Boost.Regex (dependencies for Boost.Log taken from here)
5) copy/paste this example
The command that CodeBlocks uses when I try to Build:
mingw32-g++.exe -Wall -fexceptions -g
-ID:\libs\boost\include\boost-1_51 -c D:\example\example\main.cpp -o obj\Debug\main.omingw32-g++.exe -LD:\libs\boost\lib -o bin\Debug\example.exe obj\Debug\main.o D:\libs\boost\lib\libboost_filesystem-mgw44-mt-d-1_51.a D:\libs\boost\lib\libboost_system-mgw44-mt-d-1_51.a D:\libs\boost\lib\libboost_date_time-mgw44-mt-d-1_51.a D:\libs\boost\lib\libboost_thread-mgw44-mt-1_51.a D:\libs\boost\lib\libboost_regex-mgw44-mt-d-1_51.a D:\libs\boost\lib\libboost_log_setup-mgw44-mt-d-1_51.a
What else could be the cause of this?
Later added:
CodeBlocks toolchain executables are:
c++ compiler: mingw32-g++.exe
linker for dynamic libs: mingw32-g++.exe
linker for static libs: ar.exe
All .EXEs are where they should be but added this info maybe it is important.
mingw-get install gcc g++- user520288