python extension module / external linkage

Gerhard Häring g.haering at ___skynamics.com.invalid
Mon Aug 27 11:45:43 EDT 2001


John Hunter wrote:
> I am building a python extension module with boost::python and am
> getting an error 'ImportError: ./Trade.so: undefined symbol: mtInit'
> when I try to import the module in python.  mtInit is a C function
> declared in a header with 'extern "C"' and defined in an object
> library that I link against when I build the python extension module.
> None of my python wrapper classes use 'mtInit' directly, but one of
> the classes that I am wrapping does call it in its constructor.
> 
> When I build the shared library Trade.so to import into python, I
> compile it with 
> 
> g++ -shared $(LIBPATHS) $(OBJS) -o Trade.so -lboost_python -lA -lB
> [...]

I think the "-export-dynamic" switch should do the trick.

-- 
Gerhard Häring
skynamics AG
g.haering at skynamics.com
http://www.skynamics.com




More information about the Python-list mailing list