# Problems building Boost.python for GCC

## Recommended Posts

JackRabbit    122
Hi everyone! Ok, i've downloaded all the Boost stuff and got bjam.exe and all of that. Now, in the tutorial im following located here: Here I run the command bjam -sTOOLS=gcc test as instructed, but it failes, after a few seconds of a ¤"&%load of output to the screen, i scroll back and see lots of errors, and one thing in perticular caught my eye, which is this:
...failed gcc-C++-action ..\..\..\bin\boost\libs\python\build\libboost_python.li
b\gcc\debug\wrapper.obj...
...skipped <@boost!libs!python!build\libboost_python.lib\gcc\debug>libboost_pyth
on.lib for lack of <@boost!libs!python!build\libboost_python.lib\gcc\debug>numer
ic.obj...
gcc-C++-action ..\..\..\bin\boost\libs\python\test\embedding.test\gcc\debug\embe
dding.obj
In file included from C:/boost_1_32_0/boost/python/detail/prefix.hpp:13,
from C:/boost_1_32_0/boost/python/args.hpp:8,
from C:/boost_1_32_0/boost/python.hpp:11,
from ../../../libs/python/test/embedding.cpp:9:
C:/boost_1_32_0/boost/python/detail/wrap_python.hpp:30:23: pyconfig.h: No such f
ile or directory
C:/boost_1_32_0/boost/python/detail/wrap_python.hpp:54:24: patchlevel.h: No such
file or directory

I know its a bit much, but look at the last few lines, it says it cant find the pyconfig.h and other python includes. This is strange cause ive set up all the enviroment variables like instructed. I put them in a commandscript of my own which looks like this:
@set PYTHON_ROOT=c:\python24@set PYTHON_VERSION=2.4
@set PYTHON_INCLUDES=c:\python24\include@set PYTHON_LIB_PATH=c:\python24\libs
@set GCC_BIN_DIR=c:\dev-cpp\bin@set GCC_LIB_DIR=c:\dev-cpp\lib@set GCC_INC_DIR=c:\dev-cpp\include
@set PATH=%path%;%PYTHON_ROOT%;%PYTHON_INCLUDES%;%PYTHON_LIB_PATH%;%GCC_BIN_DIR%;%GCC_LIB_DIR%;%GCC_INC_DIR%;

Sorry for all this text, i know it might be a bit hard to pinpoint what my problem is, but i was hoping someone else has had this as well and might know of a solution :) Anyway im greatful for any help on this, and let me know if im unclear about something or if u want more info from me. If you're still reading this... thanks for listening! :)

##### Share on other sites
SiCrane    11839
The most likely problem is that your python installation is borked. Make sure that C:\python24\include has the pyconfig.h and patchlevel.h headers. The other possibility is that your @sets are borked because you've run them together on one line. Like this line:
@set PYTHON_INCLUDES=c:\python24\include@set PYTHON_LIB_PATH=c:\python24\libs

Looks like should be two lines instead of one. Of course that could be a forum formatting error.

One thing to try is manually adding the boost::python src files to your project and building independently of bjam. You'll need to do a project level define for BOOST_PYTHON_STATIC_LIB and uncomment the #define BOOST_ALL_NO_LIB line in boost/config/user.hpp.

##### Share on other sites
JackRabbit    122

( And sorry for my late reply ;) )

I did as you instructed but to no avail. Building the sources myself brought
me some more headaches, and after peeking at documentation here and there,
i decided to look at alternatives so i tried SWIG which worked much better
for me.

However, i do have some questions about that also, but i think it belongs in
a new post so its easier for someone else with the same question finding
that post.

Anyway thanks a million for your help! :)

## 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