User forums > Using Code::Blocks
Boost.Asio Linking Help
JakeKazmier:
Hi,
I am trying to setup Boost C++ Libraries but I am having trouble with linking. I installed and compiled the libraries correctly and the first example provided works because it does not require linking. I referred to the BoostWindowsQuickRef and other sources but I could not find what specific files I should link when using a Boost library or where to look for them. I appreciate the help.
Thanks!
Alpha:
Do I need to link with a library for every Boost component I use?
Header-only Libraries
Asio dependencies
http://forums.codeblocks.org/index.php/topic,15164.msg101771.html#msg101771
Summary:
* Boost.System
* Boost.Regex (optional)
* OpenSSL (optional)
* ws2_32 (system - assuming you are on Windows)(To locate the Boost libraries see Set up a Code::Blocks global variable for Boost step four.)
Also, each library lists its dependencies (somewhere) in its documentation.
dajames:
It looks like you're using Windows ... if you're using the Microsoft compiler you probably don't need to specify any boost libraries because boost's autolink feature will grab them for you (using #pragma comment( lib ) directives).
If you're not on Windows, or are using GCC on Windows, then autolink is not supported and you will have to specify the library/ies you need explicitly. For boost::asio you need the boost system library and may also need the regex library. If you're building for Linux you'll also need to specify the pthread library.
It's worth comparing the two "getting started" documents to see how the use of boost on Windows and other systems differs.
http://www.boost.org/doc/libs/1_49_0/more/getting_started/windows.html
http://www.boost.org/doc/libs/1_49_0/more/getting_started/unix-variants.html
JakeKazmier:
Thank you very much.
JakeKazmier:
Actually this does not solve the problem. I get this error if this helps.
Thanks.
Uploaded with ImageShack.us
Navigation
[0] Message Index
[#] Next page
Go to full version