Alright viliml, I'll walk you through this step by step, starting a new project in my IDE (Code::Blocks). Obviously since you're not new, I don't need to tell you it's a console project, or that you need main.cpp in it. But using your code you pasted, you need to add this to the Build Options (If using an IDE that handles compiling/linking steps). I have the following files linked:
Edit: You can typically add these somewhere in the Build Options of your Project. Mine were located under the Linker Options. (Notice the lib and .a were removed when adding them)
boost_system
boost_thread
boost_chrono |
And here is the build log:
-------------- Build: Debug in Boost Threads (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -fexceptions -g -Weffc++ -Wmain -pedantic-errors -pedantic -std=c++0x -Wextra -Wall -c "C:\Programming\Boost Threads\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -o "bin\Debug\Boost Threads.exe" obj\Debug\main.o -lboost_system -lboost_thread -lboost_chrono
Output size is 1.67 MB |
If you can't get that to work, then you might need to try the boost libraries again. I don't remember needing chrono, but I kept getting linker errors about chrono so I added it and it went away. System is also needed, as well as thread (duh!).
Since you're saying you have 4.7.1, are you sure that orwell's is using the correct compiler?
Please note: libboost_system.a, libboost_thread.a, and libboost_chrono.a are typically located in:
boost_root_directory/lib
If they don't exist, you didn't install the libraries correctly.