6 Replies - 3587 Views - Last Post: 04 September 2009 - 08:57 PM Rate Topic: -----

#1 trikker  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 03-August 09

Linking to Boost Libraries in Code::Blocks

Posted 04 September 2009 - 04:48 PM

I'm having trouble linking to the Boost Libraries in Code::Blocks. I know this is a fairly specific question, but if anyone can offer any assistance it would be greatly appreciated.

Obviously I'm able to use the Boost headers that didn't need to be built, but in particular I'm trying to use Regex which needed to be built. I think I've built it correctly, because a new folder was created in my boost folder with the libraries that were built, but I'm not sure how to link it. I can compile, but when it tries to link I get an
unsigned int)]+0x22)||undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'|

If anyone has any idea how I'm supposed to set up the linker for this, that would be great. Thanks.

Edit: I use gcc as my compiler.

This post has been edited by trikker: 04 September 2009 - 04:54 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Linking to Boost Libraries in Code::Blocks

#2 eker676  Icon User is offline

  • Software Engineer
  • member icon

Reputation: 378
  • View blog
  • Posts: 1,833
  • Joined: 18-April 09

Re: Linking to Boost Libraries in Code::Blocks

Posted 04 September 2009 - 04:55 PM

Have you looked at this:
http://wiki.codebloc...WindowsQuickRef
Was This Post Helpful? 0
  • +
  • -

#3 trikker  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 03-August 09

Re: Linking to Boost Libraries in Code::Blocks

Posted 04 September 2009 - 04:59 PM

View Posteker676, on 4 Sep, 2009 - 03:55 PM, said:



Yes, but my folders aren't set up the same way so it's a bit different. I might just start over and try to set it up EXACTLY as they did it, but I'd rather keep them where they are.
Was This Post Helpful? 0
  • +
  • -

#4 eker676  Icon User is offline

  • Software Engineer
  • member icon

Reputation: 378
  • View blog
  • Posts: 1,833
  • Joined: 18-April 09

Re: Linking to Boost Libraries in Code::Blocks

Posted 04 September 2009 - 05:15 PM

I would suggest uninstalling and then reinstalling. It will take up 5 minutes of your time and everything will be fixed.
Was This Post Helpful? 0
  • +
  • -

#5 trikker  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 03-August 09

Re: Linking to Boost Libraries in Code::Blocks

Posted 04 September 2009 - 05:40 PM

View Posteker676, on 4 Sep, 2009 - 04:15 PM, said:

I would suggest uninstalling and then reinstalling. It will take up 5 minutes of your time and everything will be fixed.


Well it's not just uninstalling and reinstalling, you have to download and then build the libraries. For some reason when I use the command
bjam --toolset=gcc "--prefix=<installpath>" install

instead of putting the contents in that path it creates a folder called install-proper.

Edit: I set a path to MinGW's compiler execs and hopefully it will now work.

This post has been edited by trikker: 04 September 2009 - 07:39 PM

Was This Post Helpful? 0
  • +
  • -

#6 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: Linking to Boost Libraries in Code::Blocks

Posted 04 September 2009 - 07:48 PM

There seem to be issues at hand here, then. The first is how to link to libraries, and the second is how to install Boost on your system. The latter, what OS are you on?

The former, it's all based on your compiler, on how to link to libraries. The Boost Getting Started page tells you the two ways linking is done (see 6 Link Your Program to a Boost Library). The documentation suggests two ways, and I recommend following method B as listed there.
Was This Post Helpful? 0
  • +
  • -

#7 trikker  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 03-August 09

Re: Linking to Boost Libraries in Code::Blocks

Posted 04 September 2009 - 08:57 PM

View PostOler1s, on 4 Sep, 2009 - 06:48 PM, said:

There seem to be issues at hand here, then. The first is how to link to libraries, and the second is how to install Boost on your system. The latter, what OS are you on?

The former, it's all based on your compiler, on how to link to libraries. The Boost Getting Started page tells you the two ways linking is done (see 6 Link Your Program to a Boost Library). The documentation suggests two ways, and I recommend following method B as listed there.


Edit: I finally got it to work by going to Linker settings and adding all of the libraries into it rather than using a "search directory" type thing.

This post has been edited by trikker: 04 September 2009 - 09:07 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1