Author Topic: [SOLVED] CodeBlocks link libboost  (Read 13667 times)

Offline str0g

  • Multiple posting newcomer
  • *
  • Posts: 20
[SOLVED] CodeBlocks link libboost
« 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.
« Last Edit: January 23, 2010, 05:38:06 pm by str0g »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: CodeBlocks link libboost
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline str0g

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: CodeBlocks link libboost
« Reply #2 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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CodeBlocks link libboost
« Reply #3 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).

Offline str0g

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: CodeBlocks link libboost
« Reply #4 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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: CodeBlocks link libboost
« Reply #5 on: January 23, 2010, 05:01:07 pm »
just to be sure, you want this for linux right ?

Offline str0g

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: [SOLVED] CodeBlocks link libboost
« Reply #6 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.

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: [SOLVED] CodeBlocks link libboost
« Reply #7 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



« Last Edit: June 02, 2010, 04:47:38 pm by nanyu »