Sign in to follow this  
Endar

Setting up the boost library

Recommended Posts

Okay, I've downloaded a zip of the boost library, and I'm using VC++ 6. Could someone give me a quick rundown of how to set up the boost library for use? I've read the stuff on the website, but it is a mite confusing for me.

Share this post


Link to post
Share on other sites
The Getting Started documentation could use work, I agree. I'm currently using it with MinGW and have gotten it to work with the borland compiler.

I'll assume you're having trouble with step 5 which is probably the most difficult part.

for VC6, you would probably want
bjam "-sTOOLS=msvc" install

That will install it to the default directory, which on w32 systems is c:\boost .

Use the --includedir and --libdir options to modify the include and library directories respectively.

Also, I'd reccomend updating youre compiler, some boost libs can really push the limits of your compiler and vc6 isn't particularly well known for having the best standards compliance.

Good luck.

Share this post


Link to post
Share on other sites
I personally ignore most of the boost installation instructions, and set it up like so:

1. unzip to a directory. Say C:\include\ for example. This creates a directory C:\include\boost_1_32_0\
2. add the C:\include\boost_1_32_0\ directory to the IDE's include path,
3. modify C:\include\boost_1_32_0\boost\config\user.hpp by uncommenting the #define BOOST_ALL_NO_LIB line.

That pretty much leaves you ready to go for most uses of boost. Later, if you need to use boost modules that have separate code files, like boost::thread or boost::filesystem, then you can just add the relevant files to your project instead of having to deal with building and linking the DLLs.

Share this post


Link to post
Share on other sites
Okay, here I'm a little confused.

I downloaded the bjam zip file and I ran 'build.bat' and I got this output:

[source="cpp"]
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>cd downloads

C:\Downloads>cd boost-jam-3.1.10

C:\Downloads\boost-jam-3.1.10>dir *.bat
Volume in drive C is Local Disk
Volume Serial Number is 4C99-8E3C

Directory of C:\Downloads\boost-jam-3.1.10

29/05/2004 01:50p 14,102 build.bat
1 File(s) 14,102 bytes
0 Dir(s) 4,163,923,968 bytes free

C:\Downloads\boost-jam-3.1.10>build
Setting environment for using Microsoft Visual C++ tools.
###
### Using 'msvc' toolset.
###

C:\Downloads\boost-jam-3.1.10>rd /S /Q bootstrap.msvc
The system cannot find the file specified.

C:\Downloads\boost-jam-3.1.10>md bootstrap.msvc

C:\Downloads\boost-jam-3.1.10>cl /nologo /GZ /Zi /MLd -DNT -DYYDEBUG kernel32.lib advapi32.lib /Febo
otstrap.msvc\jam0 command.c compile.c execnt.c execunix.c execvms.c expand.c filent.c fileos2.c fil
eunix.c filevms.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.
c newstr.c option.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c subst.c timestamp.
c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c w32_getreg.c native.c modules/se
t.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c
command.c
compile.c
execnt.c
execunix.c
execvms.c
expand.c
filent.c
fileos2.c
fileunix.c
filevms.c
glob.c
hash.c
hdrmacro.c
headers.c
jam.c
jambase.c
jamgram.c
lists.c
make.c
make1.c
Generating Code...
Compiling...
newstr.c
option.c
parse.c
pathunix.c
pathvms.c
regexp.c
rules.c
scan.c
search.c
subst.c
timestamp.c
variable.c
modules.c
strings.c
filesys.c
builtins.c
pwd.c
class.c
w32_getreg.c
native.c
Generating Code...
Compiling...
set.c
path.c
regex.c
property-set.c
sequence.c
order.c
Generating Code...

C:\Downloads\boost-jam-3.1.10>.\bootstrap.msvc\jam0 -f build.jam --toolset=msvc "--toolset-root=C:\P
rogram Files\Microsoft Visual Studio\VC98\ " clean
...found 1 target...
...updating 1 target...
...updated 1 target...

C:\Downloads\boost-jam-3.1.10>.\bootstrap.msvc\jam0 -f build.jam --toolset=msvc "--toolset-root=C:\P
rogram Files\Microsoft Visual Studio\VC98\ "
...found 83 targets...
...updating 5 targets...
.mkdir. bin.ntx86
spawn: No such file or directory
C:\Downloads\boost-jam-3.1.10>



So, did something go wrong at 'spawn'?

This created an exe file: 'jam0.exe' and I tried to run that, and it said I had to set the JAM_TOOLSET environment variable.

So, I did that (I think), and I ran it again, but it stopped and doesn't look like it really did anything.

[source="cpp"]
C:\Downloads\boost-jam-3.1.10\bootstrap.msvc>set JAM_TOOLSET=VISUALC

C:\Downloads\boost-jam-3.1.10\bootstrap.msvc>jam0
Compiler is Microsoft Visual C++
Jamfile: No such file or directory
...found 7 targets...

C:\Downloads\boost-jam-3.1.10\bootstrap.msvc>


Share this post


Link to post
Share on other sites
For VC8 (Visual Studio 2005; I know this works. Replace vc-8_0 with vc-7_1 and VC80_ROOT with VC71_ROOT for 2003)

bjam "-sTOOLS=vc-8_0" "-sVC80_ROOT=%VCINSTALLDIR%"
"-sPYTHON_ROOT=C:\Python23" "-sPYTHON_VERSION=2.3"
--with-python-root=c:\Python23 --builddir=c:\boost-build-vc8 install

You might have to change for your python installation.

For VC6 (I think; I don't have VC6)

bjam "-sTOOLS=msvc" "-sMSVC_ROOT=%VCINSTALLDIR%"
"-sPYTHON_ROOT=C:\Python23" "-sPYTHON_VERSION=2.3"
--with-python-root=c:\Python23 --builddir=c:\boost-build-vc6 install


Both of these assume you have already run VCVARS32.bat (probably under your start menu somewhere) and have cd'd to the directory where you unzipped boost, and that you have bjam in your path.

This will install the boost libs in C:\Boost.

Share this post


Link to post
Share on other sites

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