perception_open3d icon indicating copy to clipboard operation
perception_open3d copied to clipboard

Undefined refrence to ros::

Open chris-aeviator opened this issue 4 years ago • 6 comments

When building the examples via catkin build. open3d_conversions builds fine. Running on ros-melodic "official" docker container

EDIT: same happens when running catkin_make

image image

chris-aeviator avatar Nov 28 '20 14:11 chris-aeviator

Hello @chris-aeviator. It seems the linking step fails and catkin doesn't link against the ROS libraries. I have been unable to replicate the error and it builds fine for me. The only difference seems to be the package name and as long as you have changed that in the package.xml and have not removed L17 <depend>roscpp</depend> that should not be a problem. Could you please let me know the compiler version you are using? Could you also try to build again after shifting your workspace from /opt to your home directory.

Matnay avatar Dec 12 '20 07:12 Matnay

Hi, I have the same error as @chris-aeviator. Screenshot from 2021-02-15 13-26-31 Screenshot from 2021-02-15 13-27-36

erik-fustes avatar Feb 15 '21 12:02 erik-fustes

I had the same undefined references issue today as @TuVieja, @chris-aeviator, and managed to find a fix after some trial and error. When compiling Open3D from source, go into the top level CMakeLists file, and set GLIBCXX_USE_CXX11_ABI to ON instead of OFF.

I am running ubuntu 20, noetic, gcc 9.3, no docker just a standard setup, and this fixed the issue for me. This is probably more of a workaround then a solution, since the machine learning module of Open3D is not compiling yet for me with this setup, but at least this got the core of Open3D working with ROS, and this nice package as well for me. This might need to be looked into or at least noted down for the sake of future compilations @Matnay

Ezzence avatar Mar 11 '21 23:03 Ezzence

Hello @Ezzence, Thank you for providing a workaround. Sure, I did look into it but was unable to replicate the error, which in hindsight, was because I had compiled Open3D from source with the flags set to the following configuration: -DBUILD_UNIT_TESTS=ON -DBUILD_EIGEN3=ON -DBUILD_GLEW=ON -DBUILD_GLFW=ON -DBUILD_JSONCPP=ON -DBUILD_PNG=ON -DGLIBCXX_USE_CXX11_ABI=ON

Evidently, there existed issues (#414) on using ROS with Open3D that are resolved using your workaround. Although the update proposed above resolves the present issue, I will explore whether a better solution exists for the sake of future compilations.

Matnay avatar Mar 12 '21 06:03 Matnay

Same thing here, using c++ version of Open3D alongside PCL. CMAKE was reporting undefined reference to "pcl_visualizer.h" and some other headers.

The "Setting GLIBCXX_USE_CXX11_ABI to ON" workaround worked like a charm, saved my life quite literally. Looking forward to future updates.

tota1Noob avatar Apr 06 '21 10:04 tota1Noob

This worked for me as well:

cmake -DGLIBCXX_USE_CXX11_ABI=ON ..

incebellipipo avatar Jul 11 '21 19:07 incebellipipo