envire / envire-envire_core

Core part for the Environment Representation library
BSD 2-Clause "Simplified" License
7 stars 13 forks source link

/usr/local/lib/libenvire_core.so: undefined symbol: _ZN12class_loader20class_loader_private25getFactoryMapForBaseClassERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE #45

Closed HWiese1980 closed 5 years ago

HWiese1980 commented 5 years ago

I was able to compile libenvire_core.so but upon trying to use it from within a boost::python extension, I'm getting the following error:

/usr/local/lib/libenvire_core.so: undefined symbol: _ZN12class_loader20class_loader_private25getFactoryMapForBaseClassERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

Before I start investigating myself, have you guys seen this before?

arneboe commented 5 years ago

The error means that class_loader::class_loader_private::getFactoryMapForBaseClass(...) was defined but not linked. Probably there is a bug in the way we link envire to class_loader. Can you provide some example for me to reproduce? Or your system version of class_loader is missing that method?

HWiese1980 commented 5 years ago

Sorry, can't come up with a quick example.

It might be related to the fact though that I currently have two different versions of Boost on my system (1.58 from apt and 1.69 installed from sources). The newer version because I need boost::python::numpy and several other newer features of Boost. Envire_core links against 1.58 and the Python extension that I'm building links against 1.69. That might bear some trouble, not sure though.

However as far as I can tell, libclass_loader.so does not use Boost. So that does not seem to be the culprit.

Investigating further I cannot find _ZN12class_loader20class_loader_private25getFactoryMapForBaseClassERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE in the libclass_loader.so (using nm) but instead _ZN12class_loader4impl25getFactoryMapForBaseClassERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE...

HWiese1980 commented 5 years ago

Ah, it looks like, according to class_loader changelog that class_loader_private has been renamed to impl. But I cannot see yet where that old reference to getFactoryMapForBaseClass in envire-core comes from.

HWiese1980 commented 5 years ago

I see it now. It links against my existing /opt/ros/kinetic class_loader instead of the installed one. Makes sense. I'll see how I can make sure that it uses the correct one (probably by avoiding to source ROS first).

arneboe commented 5 years ago

Ok. Can I close the issue?

HWiese1980 commented 5 years ago

I think it can be closed for the time being. I might reopen it in case that the error persists.