[C++-sig] Question regarding boost.python and Makefiles
Herringshaw, Chris
Chris.Herringshaw at citadelgroup.com
Thu May 20 20:35:36 CEST 2004
I am exploring the use of Boost.Python for an application,
however I am stuck with a legacy limitation - the build
environment for this application is Makefile based, and
as such, I cannot easily use the Jam build system.
I need to be able to use Boost.Python with a Makefile.
I can run the getting_started1 and getting_started2 samples
if I use the includes Jam system, but as soon as I
pull those same files out of the boost distribution into
another directory, I start having issues. I scraped
together the following options to create the following
build line:
g++ -L/dev/Python-2.3.3
-L/dev/boost_1_31_0/bin/boost/libs/python/build/libboost_python.a/gcc/re
lease -I/dev/Python-2.3.3/Include -I/dev/boost_1_31_0 -Wall
-ftemplate-depth-100 -DBOOST_PYTHON_STATIC_MODULE -fno-inline -fPIC
-shared -lboost_python-gcc-1_31 -lpython2.3 -Wl,-soname,chris.so -o
chris.so
This compiles fine. Here is the source file:
#include <iostream>
#include <string>
#include <boost/python.hpp>
#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
BOOST_PYTHON_MODULE_INIT(chris)
{
}
Here is the python file:
#!/dev/Python-2.3.3/python
from chris import *
And when I run the script, here is what I get:
Traceback (most recent call last):
File "./pythonboost.py", line 3, in ?
from chris import *
ImportError: dynamic module does not define init function (initchris)
I have checked the mailing list archives, and only find a
few references to this kind of issue, none of which came
to a solid conclusion on the cause. One suggested a name
difference between the module name in the source and in the
python script, which is not the case here.
So, is there a HOWTO or other suggestions on how I might be
able to use this potentially great package in my project?
Thank you!
Chris
-------------------------------------------------------------------------------------------------
-------------------------
CONFIDENTIALITY AND SECURITY NOTICE
This e-mail contains information that may be confidential and
proprietary. It is to be read and used solely by the intended recipient(s).
Citadel and its affiliates retain all proprietary rights they may have in the
information. If you are not an intended recipient, please notify us
immediately either by reply e-mail or by telephone at 312-395-2100
and delete this e-mail (including any attachments hereto) immediately
without reading, disseminating, distributing or copying. We cannot give
any assurances that this e-mail and any attachments are free of viruses
and other harmful code. Citadel reserves the right to monitor, intercept
and block all communications involving its computer systems.
More information about the Cplusplus-sig
mailing list