Skip to main content
GameDev.net gamedev.net
🔒 Locked

installing boost

Started by SpacedOut Aug 7, 2006 at 7:27 PM 8 replies 1.3k views
Original Post
SpacedOut
SpacedOut
I've looked through every tutorial on www.boost.org, run multiple google searches, checked wiki pages, searched through this forum, searched other forums, and even looked through the boost mailing list. If anyone could help me with this, I would greatly appreciate it. I downloaded boost into C:\boost_1_33_1, and put the bjam executable in the same directory. I intend to build with VS 2005, I'm on Windows XP. First I changed the directory: cd C:\boost_1_33_1 VS 2005 is installed in the default directory listed on the boost website: C:\Program Files\Microsoft Visual Studio 8\VC so I tried to install boost, here's what I got:

C:\boost_1_33_1>bjam "-sTOOLS=vc-8_0" install
******************************************************
Building Boost.Iostreams with bzip2 support disabled.
To enable bzip2, consult the Boost.Iostreams documentation
******************************************************
******************************************************
Building Boost.Iostreams with zlib and gzip support disabled.
To enable zlib and gzip, consult the Boost.Iostreams documentation
******************************************************
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(and if you don't know what ICU is then you probably don't need it).
...patience...
...patience...
...found 13371 targets...
...updating 4941 targets...
MkDir1 C:\Boost
spawn: No such file or directory

This problem has been driving me crazy for over a week, if anyone could help me I'd greatly appreciate it. Thanks.
SiCrane
SiCrane
Ok this is what I do, which isn't necessarily a good idea:

For the majority of boost, all you need to do is unzip boost to a directory and add the directory to your include path in Visual Studio. As long as you uncomment #define BOOST_ALL_NO_LIB in boost/config/user.hpp, for the rest you can do the horrible hack of adding the relevant boost source files to your project when using the libraries that require a build like boost::python or boost::program_options.

Again, this isn't a recommended or officially supported method of using boost, but it works for most circumstances.
SpacedOut
SpacedOut
Thanks a lot SiCrane. I'm sorry, I should have mentioned earlier I wanted to use boost python. I uncommented #define BOOST_ALL_NO_LIB, but I still got a bunch of linker errors relating to unresolved externals. I looked through boost/python, but I didn't see any source files, just .hpp files. What is this "horrible hack" you speak of?

Here's my code:

#include <boost/python.hpp>#include <iostream>using namespace boost::python;using std::cout;int main(int argc, char **argv){	Py_Initialize();	object main_module((	handle<>(borrowed(PyImport_AddModule("__main__")))));	object main_namespace = main_module.attr("__dict__");	handle<> ignored((PyRun_String(		"hello = file('hello.txt', 'w')\n"		"hello.write('Hello world!')\n"		"hello.close()"	  , Py_file_input	  , main_namespace.ptr()	  , main_namespace.ptr())	));	Py_Finalize();	return 0;}
MaulingMonkey
MaulingMonkey
Did you run C:\install\path\Common7\Tools\vcvars32.bat as the documentation tells you to?

Betchya didn't.

Make sure you read the Boost.Python - Building and Testing section as well, which contains special steps for enabling that library.
SpacedOut
SpacedOut
OK, I ran VCVARS32.BAT from my VS 2005 installation path. This time I got:

******************************************************Building Boost.Iostreams with bzip2 support disabled.To enable bzip2, consult the Boost.Iostreams documentation************************************************************************************************************Building Boost.Iostreams with zlib and gzip support disabled.To enable zlib and gzip, consult the Boost.Iostreams documentation******************************************************Building Boost.Regex with the optional Unicode/ICU support disabled.Please refer to the Boost.Regex documentation for more information(and if you don't know what ICU is then you probably don't need it)....patience......patience......found 13371 targets......updating 4939 targets...MkDir1 binspawn: No such file or directory


so instead of "MkDir1 C:\Boost" I got "MkDir1 bin". I tried changing my directory to libs\python\build as suggested in the link you gave me, and got:

C:\boost_1_33_1\libs\python\build>bjam "-sTOOLS=vc-8_0" installdon't know how to make install...found 1 target......can't find 1 target...


EDIT: I have Python 2.4 installed in C:\Python24
Nitage
Nitage
Try the boost installer:
http://www.boost-consulting.com/download.html
SiCrane
SiCrane
Here is my article on embedding Python with boost::python. The appendix at the end describes how to add the source files to your project without bjam.
load_bitmap_file
load_bitmap_file
I was about to suggest just using bjam (very simple installation) when I saw this:

Quote:
Original post by Nitage
Try the boost installer:
http://www.boost-consulting.com/download.html


Sweet, I didn't know they offered prebuilt binaries. Thanks for the link.
SpacedOut
SpacedOut
awesome, I didn't know they had pre-built libraries. Thanks a lot Nitage. And thanks for the article SiCrane. I'm surprised that didn't turn up when I searched this site for 'boost python'.

I had no trouble embedding python in a C++ app, but I still can't seem to build a python extension. It keeps referencing a "bin" directory, but there isn't one, and I don't see where it should have been created. I'm probably missing something in the building instructions, but I can't see what.

Here's what I got:

C:\Program Files\boost\boost_1_33_1\libs\python\example\tutorial>bjam -sTOOLS=vc-8_0...patience......found 1508 targets......updating 46 targets...MkDir1 binspawn: No such file or directory
SpacedOut
SpacedOut
An update, I've been working on this myself, and I realized it's looking for a directory "bin":

Mkdir1 bin
spawn: No such file or directory

After I created that directory myself, I found it was looking for a directory "bin\boost":

MkDir1 bin\boost
spawn: No such file or directory

After I created that one, it was looking for "bin\boost\libs"

MkDir1 bin\boost\libs
spawn: No such file or directory

Etc... Until I got all the way to:

MkDir1 bin\boost\libs\python\build\boost_python.dll
spawn: No such file or directory

The tutorial said it would create boost_python.dll itself. So does this mean bjam is not able to create directories on it's own? Is that the problem?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.