News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Linking Boost

Started by Luc Lieber, February 12, 2012, 04:49:33 PM

Previous topic - Next topic

Luc Lieber

I have a bad feeling that I already know the answer, but code::blocks doesn't provide a way to recursively add all libraries in a directory, does it?  Has anyone out there actually pilfered through the hundreds of directories generated by boost.build and manually added in the required libraries?  If so, what were you thinking?  Do you like pain??

Also, the build log window seems to auto-close itself after a successful compilation.  Is there any way to make it not auto-close?

MortenMacFly

Quote from: Luc Lieber on February 12, 2012, 04:49:33 PM
Has anyone out there actually pilfered through the hundreds of directories generated by boost.build and manually added in the required libraries?
My fully-compiled boost has exactly 19 libs and in my application I use 3-5 of these at max. Maybe you should try to better understand how boost works and when/what you need to link against. Notice that boost usually does not even require any library unless you are using platform specific stuff like threads. Even then, its one lib (for example).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Luc Lieber

#2
And so the black-box approach of using libraries crumbles away into dust...suddenly, one has to research how the library works in order to use it.


Sorry if I sound disappointed, I just spent literally an entire week trying to set up mingw-w64 and that took more research than anything that I've ever attempted before.  Moving from MSVC to GCC was is the single biggest pain that I've ever experienced.

The libraries that I require are:
   Boost::Asio
   Boost::Filesystem
   Boost::IOStreams
   Boost::Regex
   Boost::Serialization
   Boost::Thread

in 32 and 64 bit flavors.

If there are indeed only 19 libraries, then I've done something wrong when building boost, because I have a hellova lot more than that in subdirectories debug/link-static, debug/threading-multi, release/link-static, debug/threading-multi, debug/link-static/, nested as deep as
C:\libraries\boost_1_47\lib\mingw\chrono\build\gcc-mingw-4.6.1\release\link-static\runtime-link-static\threading-multi

If I may inquire, which *.lib / *.a files should be added to code::blocks' linker settings?  The ones in the top-most (release / debug) directories?

MortenMacFly

Quote from: Luc Lieber on February 12, 2012, 05:12:39 PM
If I may inquire, which *.lib / *.a files should be added to code::blocks' linker settings?  The ones in the top-most (release / debug) directories?
Oh dear, this is off-topic and actually should be asked in boost forums, but here you go:

You most likely compiled the 19 libs in 6 flavours. Depending on what of these flavours you want to use (debug/release/dynamic/static/32bit/64bit) you have to add exactly that library. So, if you write:
Quote from: Luc Lieber on February 12, 2012, 05:12:39 PM
The libraries that I require are:
   Boost::Asio
   Boost::Filesystem
   Boost::IOStreams
   Boost::Regex
   Boost::Serialization
   Boost::Thread
...you have to add at max 6 boost libraries.

As an example. If you want to use Boost::Asio dynamically linked (DLL) for a 32 bit application in release mode use exactly that lib.

You cannot simply link against all boost libs and then hope the linker will do the right thing. This will fail!

For more information, please ask in the boost forum. Topic locked.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]