Boost logo

Boost :

Subject: [boost] [python] Help with boost python build
From: Andy Thomason (a.thomason_at_[hidden])
Date: 2015-08-10 07:36:49

Hi All,

I have had highly variable results with Boost.Python mostly due to
linker errors
or failures of Python to find DLLs.

Python is not great at reporting why it fails, for example not naming
to load dependent DLLs on Windows which does not make this a joyous

I have never managed to get any Boost.Python example - mine or otherwise
- working
on Windows and have had limited success on Linux. It is little surprise
that all the
examples on Stackoverflow avoid Bjam for builds.

For my genetics library, I have an example that has a single source file
and the Jamfile
reads thus:

python-extension genetics : bindings.cpp :
<toolset>gcc:<cxxflags>-std=c++11 ;


using python : 2.7 ;

in ~/boost-config.jam

ie. as minimal as possible.

This builds well on linux (I am adding a library to the head of modular

When I run:

python -c "import genetics"

with appropriate PYTHONPATH

I get a run-time symbol search error:

ImportError: <...>/ undefined symbol:

My guess would be that rather than this one symbol, Python is failing to
load the shared lib:


As a postscript, It would be lovely if there were no static or dynamic
libraries to link with
when compiling with Boost.Python and a unity build would be a nice
option as this would bypass
linker and runtime related errors. It would probably compile faster in
my long experience
with such projects.

Any help would be welcome.


This email has been checked for viruses by Avast antivirus software.

Boost list run by bdawes at, gregod at, cpdaniel at, john at