I am running Code::Blocks version 13.12 on Windows 7. The compiler I use is MinGW GCC version 5.1.0.
When I try to use the Boost library in my project, the files aren't found. I tried to follow the steps on the wiki page, I also tried to build the boost library but I only get this error:
O:\developement\CPP\boost_1_46_1\boost_1_46_1>bootstrap.bat --toolset=gcc "--pre
fix=C:\asdf\" install
Building Boost.Jam build engine
Der Befehl "cl" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Failed to build Boost.Jam build engine.
Please consult bjam.log for furter diagnostics.
You can try to obtain a prebuilt binary from
http://sf.net/project/showfiles.php?group_id=7586&package_id=72941
Also, you can file an issue at http://svn.boost.org
Please attach bjam.log in that case.
I thought it wasn't necessary to build the library because it's already included with the compiler, but I still don't really know how to use it.
Build log:
-------------- Build: Debug in Project3 (compiler: GNU GCC Compiler)---------------
g++.exe -Wall -fexceptions -g -std=c++11 -IC:\Qt\5.5\msvc2013_64\include -IO:\developement\CPP\boost-1.30.1\boost-1.30.1\include -IC:\MinGW\MinGW\include\boost -IC:\Users\maxim\Documents\Development\CPP\cpp_project\Project3 -c C:\Users\maxim\Documents\Development\CPP\cpp_project\Project3\main.cpp -o obj\Debug\main.o
C:\Users\maxim\Documents\Development\CPP\cpp_project\Project3\main.cpp:4:25: fatal error: boost/asio.hpp: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 7 second(s))
1 error(s), 0 warning(s) (0 minute(s), 7 second(s))
So you are using MinGW as your compiler and Visual Studio compiled binaries for Qt:
-IC:\Qt\5.5\msvc2013_64\include
Do you have a reasoning for that?
From what I see from your build log:
-IO:\developement\CPP\boost-1.30.1\boost-1.30.1\include
-IC:\MinGW\MinGW\include\boost
you should have the file:
O:\developement\CPP\boost-1.30.1\boost-1.30.1\include\boost\asio.hpp
or
C:\MinGW\MinGW\include\boost\boost\asio.hpp
Do you have either one of these files? If not, then you're not including the correct paths.
If your compiler includes boost why are you using a separate boost installation?
Also please don't ask boost (or any other library) related questions here. None of those are supported nor allowed unless it's a CodeBlocks related problem.
Btw current boost version is 1.58 or something, why do you use such old boost versions (1.30, 1.46)?
I am not using MinGW, but I am using boost (old version, but ignore that)
I have created a Code::Blocks global variable "boost"
base: [path]\boost\boost_1_49_0
include: [path]\boost\boost_1_49_0
lib: [path]\boost\boost_1_49_0\stage\lib
(replace [path] with the path to where your boost is installed. Obviously set the version number to the relevant number you are using)
Then in your project build options "Search directories", add
compiler: $(#boost.include)
linker: $(#boost.lib)
Sometimes you also have to add the library name in the "linker settings",