User forums > Help

[solved] A problem with setting up boost

(1/2) > >>

Nelarius:
Hi!

I'm new to Code::Blocks and haven't had to set up libraries up before. I'm trying to get boost up and running (I was using this tutorial) but i've been running into problems. My Code::Blocks doesn't seem to recognize where my boost folder is located. So this


--- Code: ---#include <boost/numeric/ublas/matrix.hpp>
--- End code ---

leads to
--- Code: ---fatal error: boost/numeric/ublas/matrix.hpp: No such file or directory
--- End code ---
when I try to build the project.

I'm using Code::Blocks with windows and MinGW. What I've currently done:

I've created a global variable called boost and set the base field to the root of where I installed boost.
Currently in my project build options:
Search directories: Compiler: C:\Boost\include
Search directories: Linker: C:\Boost\lib

As for what link libraries to include, I'm not sure... As far as I understand I don't always need to put anything there as it depends on what is included?

I originally put $(#boost) and $(#boost.lib) into the search directory boxes as per the tutorial, but the outcome was the same. Help would be appreciated!

MortenMacFly:

--- Quote from: Nelarius on January 18, 2012, 07:23:40 pm ---Search directories: Compiler: C:\Boost\include
Search directories: Linker: C:\Boost\lib

--- End quote ---
I am not sure about the "lib" folder, but no boost I know does have a sub-folder named "include". Setup the path correctly.

Nelarius:
Interesting, because mine does. ??? I actually tinkered with that folder, as the headers were initially in ...\include\boost-1_48\boost\. I wonder if I have installed boost correctly then?

Jenna:

--- Quote from: Nelarius on January 18, 2012, 08:16:34 pm ---Interesting, because mine does. ??? I actually tinkered with that folder, as the headers were initially in ...\include\boost-1_48\boost\. I wonder if I have installed boost correctly then?

--- End quote ---
If you have moved files manually your installation is most likely broken.
The most secure way to fix this is to re move boost and reinstall it.

You should use the path containing the boost-subfolder as base for the global compiler var (in your case [\path\to]\boost-1_48) and use $(#boost) as (one of the) compiler search dir(s).
That should fix at least the include-issue.
I never used a compiled version of boost (just some headers), so that's all I can help.

Nelarius:

--- Quote from: jens on January 18, 2012, 08:38:35 pm ---You should use the path containing the boost-subfolder as base for the global compiler var (in your case [\path\to]\boost-1_48) and use $(#boost) as (one of the) compiler search dir(s).

--- End quote ---
Ok, restored the old file structure and this did the trick. Seems to work for now :)

Thanks for your replies!

Navigation

[0] Message Index

[#] Next page

Go to full version