This will set you up with a top notch development environment for C++ in Windows. Also this will tell you how to get the Boost::Python libraries to work with as well (which can never be a bad thing).
- Download Visual C++ 2005 Express from here.
- Then go and install the Platform SDK. I recommend installing it into C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK as then the environment variables are already set up for you in VC8.
- Go and download Python where the latest version is 2.5. Install Python 2.5 to the default installation directory of c:\Python25.
- Now it is time to download Boost and make sure you download the source and a precompiled bjam build tool.
- Extract Boost to a temporary directory on your hard drive, and copy the bjam.exe into the Boost directory.
- Open a command prompt in the Boost root directory(where you copied bjam.exe to).
- Run the batch file for registering Visual Studio commandline variables : C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat
- Run the following command line to compile and install Boost in "c:\Boost" with no checked iterators:bjam "-sTOOLS=vc-8_0" "-sPYTHON_VERSION=2.5" "-sPYTHON_ROOT=c:\Python25" "-sBUILD=debug release <define>_CRT_NONSTDC_NO_DEPRECATE <define>_CRT_SECURE_NO_DEPRECATE <define>_SECURE_SCL=0 <define>_SCL_SECURE_NO_DEPRECATE <define>_HAS_ITERATOR_DEBUGGING=0" install
- What I tend to do then is copy Boost to where my development libraries go, and then add those directories to the lib and include directories in Visual C++.
3 comments:
Hi Garry,
I don't think that the command-line to bjam that you list is exactly right. With the preprocessor options/defines listed as you have them, bjam interprets the defines as targets, and you get 4 extra builds :)
It looks like each define should have < define > prepended.
e.g.
< define >_CRT_SECURE_NO_DEPRECATE
Note, there should not be a space between the <, >, and the word define. I had to put the space in because the blog commenter won't allow that tag.
Cheers.
Oh damn! That means I have been using it without all the switched off stuff. Thanks for the heads up.
Unfortunately running bjam verbosely gives far too much output, but I have also fixed another problem I spotted as it whizzed past on the DOS command prompt (to do with deprecated C library functionality).
There is still the "Og" flag warning but hopefully that will be fixed in Boost 1.34 as it is not a problem in VC++ 8 (but will be when it is removed in future versions).
Check out the updated post. Overall it makes the Boost library build a whole 1Mb smaller ;)
Thanks!
Garry
To stop things whizzing past, run it at the command line like so:
bjam blah blah > build_log.txt 2>&1
then open up the text file in a good text editor and reload to watch the new stuff come in...
Post a Comment