Sign in to follow this  

boost C++ Lib - How do you use install it? [solved]

This topic is 4377 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

Hi there.... I have been looking at (and recommended to look at) a libary called boost. As I understand it is a collection kinda like STD that comes with c++. Among its features that I am interested in is the Multi Array, the Regular Expression lib and the Tokenizer The thing is I am very new to programming and do not understand the install instructions... I am using VS2005 and would like some help in getting the boost libs working in it... I couldn't find any place on the boost web site to ask these questions... .. . . [Edited by - jyujinkai on December 16, 2005 9:35:08 PM]

Share this post


Link to post
Share on other sites
Most of the components are implemented in header files, so you can just download it and put the headers into your compiler's include directory. However, some need to be built using their tools, and this is the part that has always confused me. I have not been able to use any components that need to be built because I always get errors.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Boost 1.33.1 will not cleanly build on VS 2005.

In any case this is the command line I use:

bjam install --layout=system --libdir=lib/ --includedir=include/

Of course you need bjam (boost Jam) in your path.

Share this post


Link to post
Share on other sites
Boost is worth the effort, although there is a learning curve. Check out a book on boost by Karlsson if you are interested in how to use some of the libraries.

To install:

Step 1: Download the zip and unzip it.

Step 2: Get the prebuilt jam executable and unzip it. Put that directory in your path. (Edit Path by using Control Panel...System..Advanced....Environemnt Variables)

Step 3: Open Visual Studio command prompt. Browse to boost directory.
Run: bjam "-sTOOLS=vc-8_0" install (if using VS2005)


That will build all the libraries.

To use them in your project, edit your directories within VS using:
Tools...Options....Projects and Solutions...VC++ Directories.
The drop-down on the right controls whether you are changin include directories or lib directories. e.g. Add the boost directory to the list of include directories.

Hope that helps....


Happy Coding

Share this post


Link to post
Share on other sites
Quote:
Original post by jyujinkai
@HellRiZZer - that is the tutorial that I can not understand :(

Perhaps you could tell us what parts of the tutorial confuse you.

Share this post


Link to post
Share on other sites
Quote:
Original post by SnakeHunta
Quote:
Original post by Anonymous Poster
Boost 1.33.1 will not cleanly build on VS 2005.


Umm.. I just built it yesterday in VS2005 with no errors whatsoever.


Maybe he's talking about the deprecation warnings? Although I wonder why that would single out v.1.33.1...

Share this post


Link to post
Share on other sites
@AzCoder - Ok everything seamed to work correctly.... when I added the directory to VC2005, I chose the root of the unarchived pack... is that correct?

Also once it isinstalled do I use
#include <boost>
using namespace boost;

??

Share this post


Link to post
Share on other sites
Quote:
Original post by jyujinkai
@AzCoder - Ok everything seamed to work correctly.... when I added the directory to VC2005, I chose the root of the unarchived pack... is that correct?


No, look under C:\Boost (IIRC. I myself send it somewhere else). You want C:\Boost\include\boost-1_33_1 and C:\Boost\lib.

Quote:
Also once it isinstalled do I use
#include <boost>


No. There is no boost header. There are a number of header files under the boost directory, which means you need to use, for example, #include <boost/shared_ptr.hpp>.

Quote:
using namespace boost;


As necessary.

Share this post


Link to post
Share on other sites

This topic is 4377 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this