Code::Blocks Forums

User forums => Help => Topic started by: Nelarius on January 18, 2012, 07:23:40 pm

Title: [solved] A problem with setting up boost
Post by: Nelarius on January 18, 2012, 07:23:40 pm
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 (http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef)) 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>

leads to
Code
fatal error: boost/numeric/ublas/matrix.hpp: No such file or directory
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!
Title: Re: A problem with setting up boost
Post by: MortenMacFly on January 18, 2012, 07:36:06 pm
Search directories: Compiler: C:\Boost\include
Search directories: Linker: C:\Boost\lib
I am not sure about the "lib" folder, but no boost I know does have a sub-folder named "include". Setup the path correctly.
Title: Re: A problem with setting up boost
Post by: 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?
Title: Re: A problem with setting up boost
Post by: Jenna on January 18, 2012, 08:38:35 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?
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.
Title: Re: A problem with setting up boost
Post by: Nelarius on January 18, 2012, 10:49:45 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).
Ok, restored the old file structure and this did the trick. Seems to work for now :)

Thanks for your replies!
Title: Re: [solved] A problem with setting up boost
Post by: void on January 20, 2012, 06:05:32 pm
Also, you may want to check the architecture you're trying to build for. Recent MinGW versions (especially those from TDM) are supporting both 64 and 32 bit. If you don't pass -m32 as compiler and linker option, gcc will try to find x64 builds of the libraries that may not always be present.

I know you solved your problem already, but I thought it might be a good idea to have that information right here anyways.