Setting up the boost library

Started by
4 comments, last by jdhardy 19 years, 4 months ago
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.
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
Advertisement
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.
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.
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 downloadsC:\Downloads>cd boost-jam-3.1.10C:\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.1029/05/2004  01:50p              14,102 build.bat               1 File(s)         14,102 bytes               0 Dir(s)   4,163,923,968 bytes freeC:\Downloads\boost-jam-3.1.10>buildSetting environment for using Microsoft Visual C++ tools.###### Using 'msvc' toolset.###C:\Downloads\boost-jam-3.1.10>rd /S /Q bootstrap.msvcThe system cannot find the file specified.C:\Downloads\boost-jam-3.1.10>md bootstrap.msvcC:\Downloads\boost-jam-3.1.10>cl /nologo /GZ /Zi /MLd -DNT -DYYDEBUG kernel32.lib advapi32.lib /Febootstrap.msvc\jam0  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 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/set.c modules/path.c modules/regex.c  modules/property-set.c modules/sequence.c modules/order.ccommand.ccompile.cexecnt.cexecunix.cexecvms.cexpand.cfilent.cfileos2.cfileunix.cfilevms.cglob.chash.chdrmacro.cheaders.cjam.cjambase.cjamgram.clists.cmake.cmake1.cGenerating Code...Compiling...newstr.coption.cparse.cpathunix.cpathvms.cregexp.crules.cscan.csearch.csubst.ctimestamp.cvariable.cmodules.cstrings.cfilesys.cbuiltins.cpwd.cclass.cw32_getreg.cnative.cGenerating Code...Compiling...set.cpath.cregex.cproperty-set.csequence.corder.cGenerating Code...C:\Downloads\boost-jam-3.1.10>.\bootstrap.msvc\jam0 -f build.jam --toolset=msvc "--toolset-root=C:\Program 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:\Program Files\Microsoft Visual Studio\VC98\ "...found 83 targets......updating 5 targets....mkdir. bin.ntx86spawn: No such file or directoryC:\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=VISUALCC:\Downloads\boost-jam-3.1.10\bootstrap.msvc>jam0Compiler is Microsoft Visual C++Jamfile: No such file or directory...found 7 targets...C:\Downloads\boost-jam-3.1.10\bootstrap.msvc>
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
I have to admit, I did the same thing that SiCrane did. The whole bjam idea really is too much work to setup. I wish there was a graphical frontend for the bjam util...hmmm.
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.

This topic is closed to new replies.

Advertisement