Jump to content
  • Advertisement
Sign in to follow this  
Deadlybones

Trouble getting boost C++ to work

This topic is 2587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello there. I've been trying to get boost to work so I can use boost multi array(so I don't need to build it or anything). I downloaded an installer from boostpro and downloaded boost with that. I can't seem to get the library working though. I'm not really experienced with the inner workings of IDEs and such...the problem is that I don't know how to link the library to my project. I can't seem to follow the tutorial on the boost website either as mine seems slightly different(perhaps that's the installer's fault?). Anyways, here's where it is on my PC:

C:\Program Files(x86)\boost\boost_1_47\

Apparently inside of that there is supposed to be a lib file and also a libs file. I see the libs file but there is no lib file. I assume that this is the file called boost inside which has all the header files and such. Could someone explain the step-by-step process to get this to work? After some google searching I followed a "tutorial" which told me I only needed to set the VC++ directory include so I set it to C:\Program Files(x86)\boost\boost_1_47\. I'm not sure if that is the right folder I'm supposed to link it to and I'm not sure what else I'm supposed to do to get it to work.

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Most of Boost is header-only, so putting Program Files(x86)\boost\boost_1_47\ in your include path will make all of those work. A few things, like Boost.Thread, need the library to link against. If you don't need these, you're good to go. If you don't have the lib subdirectory, then you'll want to follow one of the options in section 5 of the 'Getting Started' guide.

Share this post


Link to post
Share on other sites

Most of Boost is header-only, so putting Program Files(x86)\boost\boost_1_47\ in your include path will make all of those work. A few things, like Boost.Thread, need the library to link against. If you don't need these, you're good to go. If you don't have the lib subdirectory, then you'll want to follow one of the options in section 5 of the 'Getting Started' guide.


Thanks for the reply. If I did have the lib file would I have to link it somewhere or is having the include path set the only thing I need? Is the boost file that I have the same thing as the lib file? Inside of the boost folder is a bunch of folders with the names like multi_array etc. and inside these are the header files.

EDIT: I'm redownloading without the installer to see how things go.

EDIT2: Still no luck.

EDIT3: Ok I'm using the installer again. When I installed the other times I didn't choose any variants but this time I'll select them all(don't know what they even mean).

Share this post


Link to post
Share on other sites
If I did have the lib file would I have to link it somewhere or is having the include path set the only thing I need?


You would need C:\Program Files (x86)\boost\boost_1_47\lib as an additional library directory directory, and the specific appropriate file (bearing in mind library and variant) as an additional linker dependency.

Is the boost file that I have the same thing as the lib file?[/quote]

I don't know what you mean, sorry.

EDIT3: Ok I'm using the installer again. When I installed the other times I didn't choose any variants but this time I'll select them all(don't know what they even mean).[/quote]

You will need to do this. The meanings of the variant names are, again, in that Getting Started guide (section 6.3, further down the page).

Share this post


Link to post
Share on other sites
Thanks guys, I guess I should have read the bottom of the page. I thought it would just be technical jargon that didn't apply to me. Anyways, I already chose to install all the variants so I hope that doesn't mess anything up ;) I'll let you know how things go once I'm done downloading/installing everything.

Share this post


Link to post
Share on other sites
Okay, I feel like I'm getting close here :P Now everything looks better and it installed a lib file. I added the path to the lib in additional library directories and I added C:\Program Files(x86)\boost\boost_1_47\ to the include directories. Still it won't recognize boost though. Anything I'm missing?

Share this post


Link to post
Share on other sites
[color="#1C2837"]
and the specific appropriate file (bearing in mind library and variant) as an additional linker dependency.[/quote]

[color="#1C2837"]Sorry, I missed that. Could someone expand on this?

[color="#1C2837"]EDIT:I also missed someone's post to QuantLib installation. I'll read that now.
[color="#1C2837"]
[color="#1C2837"]EDIT2:Still no luck

Share this post


Link to post
Share on other sites
Thanks everyone for helping me get this to work! I created a new project and tried it and now it works. Couldn't have done this without you guys/gals!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!