Re: [cgkit-user] segfault help?
Brought to you by:
mbaas
|
From: Matthias B. <mat...@gm...> - 2012-04-29 22:15:22
|
Hi Alejandro,
On 28.04.12 19:07, Alejandro Aguilera Martínez wrote:
> setup(name = "Exception Test",
> ext_modules = [Extension("testmod", ["wrapper.cpp"]
> ,include_dirs=["/usr/include/boost"]
> ,library_dirs=["/usr/lib"]
> ,libraries=["libboost_python-py26.so.1.40.0"]
> )]
> )
> [...]
> g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
> build/temp.linux-i686-2.6/wrapper.o -l libboost_python-py26.so.1.40.0 -o
> build/lib.linux-i686-2.6/testmod.so
> /usr/bin/ld: cannot find -l libboost_python-py26.so.1.40.0
When the linker searches for libraries that were passed using the -l
option, it implicitly prepends the prefix "lib". So in the above case,
it actually looks for liblibboost_python-py26.so.1.40.0
The error message is not really helpful here, I agree.
Another thing is that it also adds the suffix itself. By default, it
will pick a shared library (.so) and fall back to the static library
(.a) if the shared library doesn't exist.
So the library name you have to pass to the -l option would just be
"boost_python-py26" (or "boost_python-mt-py26" or "boost_python" as you
have all those on your system. I would suggest picking the same one that
was used for building cgkit).
> $ python tst.py
> Traceback (most recent call last):
> File "tst.py", line 5, in <module>
> import testmod
> ImportError: build/lib.linux-i686-2.6/testmod.so: undefined symbol:
> _ZNK5boost6python7objects21py_function_impl_base9max_arityEv
This is just a follow-up error. It couldn't find a symbol that is part
of Boost.Python. This is not surprising as the linker couldn't find the
boost_python library when you built the module.
Cheers,
- Matthias -
|