On 11/25/2011 06:54 AM, Edgardo C. wrote:
Hello everybody,

I am having problems with importing a .so shared library I just compiled
following the example giving in the book:
API Design for C++ : www.apibook.com <http://www.apibook.com> (Chapter 11)

I downloaded the Boost library and I compiled it (fullw) into a
subdirectory called /compilation, where I get the /include and /lib
directories. No error during the compilation (Ubuntu 11.10).
Then I downloaded the code from the book examples and I compiled it
without errors and I get the phonebook.so in the same directory as where
I launch python interpreter, but the import in python trigger this error:


ImportError: /home/pablo/phonebook/phonebook.so: undefined symbol:
_ZN5boost6python6detail11init_moduleEPKcPFvvE

what I think is because python does not find the library.

I try to play around with the LD_LIBRARY_PATH variable, ldconfig, I
copied the phonebook.so library into /usr/lib and /usr/local/lib, and
nothing ... I get the same error.

Can anybody explain me what is the problem? thanks a lot in advance,


I think you just need to link your library against the boost_python library, and make sure that's also somewhere on your dynamic library path. With gcc, that means adding a "-lboost_python" to the command line options.

Jim

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to