Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: str0g on January 23, 2010, 10:04:30 am

Title: [SOLVED] CodeBlocks link libboost
Post by: str0g on January 23, 2010, 10:04:30 am
Over linux:
You have to give link which looks like -lboost_[libname] and libs linker option which where used to create boost lib.
example for threads:
-lboost_thread //to make boost partial work
-lpthread //to make it work with out error and warnings

Instaling boost over ubuntu:
Download from repository any complete boost package then overwrite it with latest stable release. (sudo cp -rf [dir_with_latest] /usr/include/boost/)

Over Windows:
yor project->bulid_options->search directories-> compiler->add(path to boost[numer_version_folder])
//still not working don't know linker options.
Title: Re: CodeBlocks link libboost
Post by: MortenMacFly on January 23, 2010, 10:20:43 am
How do I link libboost in codeblocks?
Add the required compiler/linker options for that version of boost. Project -> Right click -> Build options -> tab "compiler settings" and tab "linker settings". Notice that you really should setup a project before (which you most likely have already). See the C::B documentation (http://www.codeblocks.org/docs/main_codeblocks_en.html) for details.
Title: Re: CodeBlocks link libboost
Post by: str0g on January 23, 2010, 10:31:08 am
Add the required compiler/linker options for that version of boost.
If I knew what should I type I wouldn't bother you :P
Title: Re: CodeBlocks link libboost
Post by: Jenna on January 23, 2010, 10:47:12 am
Add the required compiler/linker options for that version of boost.
If I knew what should I type I wouldn't bother you :P

Then you are in the wrong place here !!

We do not provide support for each and every toolkit in the world !

This forum is dedicated to C::B, using C::B, problems with C::B, developping C::B, but not to general programming questions or questions about a special toolkit, that's far beyond our possibilities.

If you know what to add, but don't know how to do this, feel free to ask again (after searching the forum and the web and reading the manual of course).
Title: Re: CodeBlocks link libboost
Post by: str0g on January 23, 2010, 01:01:03 pm
I was hoping that you are using boost or you were using in the past.
On wiki.codeblocks there is empty site about boost and codeblocks so forgive me that I had hope :P
Title: Re: CodeBlocks link libboost
Post by: killerbot on January 23, 2010, 05:01:07 pm
just to be sure, you want this for linux right ?
Title: Re: [SOLVED] CodeBlocks link libboost
Post by: str0g on January 23, 2010, 05:35:34 pm
both linux and widnows, as you probably saw, I figure out how to for linux now windows part.
Title: Re: [SOLVED] CodeBlocks link libboost
Post by: nanyu on June 02, 2010, 04:39:47 pm
How do you  link boost in Code::Blocks? (in windows OS only)

Answer:

1.  if you want link boost static lib : pls add this line into "Link libraries"
   
  liblibboost_system-mgw44
 
   yes, here need double lib prefix...since C::B will remove the first "lib" :

   mingw32-g++.exe -LE:\cpp_ex_libs\boost\boost_1_42_0\lib  -o bin\Debug\asio_client.exe obj\Debug\c_main.o    -llibboost_system-mgw44
      -lwsock32 -lws2_32

 )

  or , you have to add "$(#boost.lib)\libboost_system-mgw44.lib"  into "Other linker options".
  or , rename all libboost_xxxx.lib to libboost_xxxx.a

2. and if you want link boost dynamic lib , pls :

  libboost_system-mgw44

   here, c::b remove first "lib" also:

   mingw32-g++.exe -LE:\cpp_ex_libs\boost\boost_1_42_0\lib  -o bin\Debug\asio_client.exe obj\Debug\c_main.o    -lboost_system-mgw44
      -lwsock32 -lws2_32

  or :  boost_system-mgw44

--------------------------------------------
ref :
http://forums.codeblocks.org/index.php/topic,9196.msg65770.html#msg65770
http://forums.codeblocks.org/index.php/topic,8231.0.html