boostorg / python

Boost.org python module
http://boostorg.github.io/python
Boost Software License 1.0
468 stars 201 forks source link

Undefined symbol when importing module in python #380

Open gordon7155 opened 2 years ago

gordon7155 commented 2 years ago

Hi guys

I''m trying to use boost python and then I'm exposing simple class i get undefined symbol: _ZN5boost6python15instance_holder8allocateEP7_objectmm

I checked symbols in libboost_python39.so.1.78.0 and i noticed that exist following symbol _ZN5boost6python15instance_holder8allocateEP7_objectmmm (one m more than expected)

So am I doing sth wrong or this is a bug?

My class

struct ConnectionFactory
{   
    ConnectionFactory(){} 
    ~ConnectionFactory(){}
};

Exposing by: class_<ConnectionFactory>("ConnectionFactory");

Linux Ubuntu 18.04

EDIT: I made a workaround, just modifying expected symbol using this objcopy --redefine-sym _ZN5boost6python15instance_holder8allocateEP7_objectmm=_ZN5boost6python15instance_holder8allocateEP7_objectmmm myFile.o

And this is working, but i'm not sure if this is correct approach

joriscarrier commented 2 years ago

hi,

i've the same problem with boost 1.78.0 but not with boost.1.76.0