|
Boost : |
From: Aaron Brashears (gila_at_[hidden])
Date: 2002-02-13 12:44:23
For everyone's reference, I tried many permutations of linkers,
command line parameters, command line order, and found a working
combo.
The two most important things to do (on my platform) when linking
against the python static lib to create a shared object are:
* use g++ as your linker on the command line,
* remember to pass -export-dynamic to the linker.
It's a bit of a rookie mistake, but it would have been nice to see an
example of linking against the static lib to create an so. In case
anyone else has this problem, here's an example for linking
getting_started1.o:
g++ -shared -Wl,-export-dynamic -Llibs/python/build/bin/libboost_python_static/gcc/debug/runtime-link-dynamic/shared-linkable-true getting_started1.o -lboost_python_static -o getting_started1.so
On Mon, Feb 11, 2002 at 07:43:51PM -0500, David Abrahams wrote:
> How are you doing your link? Are you using Boost.Build or are you trying to
> make it work yourself? I ask because it appears to be looking for the
> virtual table for std::runtime_error, which would happen if you didn't have
> the appropriate libraries in the link command-line for your
> platform/compiler. If you're trying to link things yourself, I suggest you
> use Boost.Build. If you're using Boost.Build, I suggest you inspect the
> command-lines it's using to see if something looks inappropriate to your
> platform.
>
> -Dave
>
> ----- Original Message -----
> From: "Aaron Brashears" <gila_at_[hidden]>
> To: "Boost" <boost_at_[hidden]>
> Sent: Monday, February 11, 2002 7:19 PM
> Subject: [boost] unresolved external symbols with Boost Python on linux
>
>
> > Hi again. I build the boost libraries, and built getting_started1
> > against the static boost libraries. Everything builds fine, and the
> > .so file is enormous (as expected), but when I try to import it into
> > python, I get the following error:
> >
> > Traceback (innermost last):
> > File "<stdin>", line 1, in ?
> > ImportError: ./getting_started1.so: undefined symbol: __vt_13runtime_error
> >
> >
> > I checked the symbol table:
> >
> > $ nm getting_started1.so | grep runtime_error
> > 0007b928 W _._13runtime_error
> > 0007b970 W __13runtime_errorRC13runtime_error
> > U
> __13runtime_errorRCt12basic_string3ZcZt18string_char_traits1ZcZt24__default_
> alloc_template2b1i0
> > U __vt_13runtime_error
> >
> >
> > As you can see, the __vt_13runtime_error symbol is in fact available
> > in the symbol table in some form. Does anyone know what might be going
> > wrong?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk