Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined refrence to ros:: #16

Open
chris-aeviator opened this issue Nov 28, 2020 · 6 comments
Open

Undefined refrence to ros:: #16

chris-aeviator opened this issue Nov 28, 2020 · 6 comments
Assignees

Comments

@chris-aeviator
Copy link

chris-aeviator commented Nov 28, 2020

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

@Matnay
Copy link
Collaborator

Matnay commented Dec 12, 2020

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.

@erik-fustes
Copy link

erik-fustes commented Feb 15, 2021

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

@Ezzence
Copy link

Ezzence commented Mar 11, 2021

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

@Matnay
Copy link
Collaborator

Matnay commented Mar 12, 2021

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.

@tota1Noob
Copy link

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.

@incebellipipo
Copy link

incebellipipo commented Jul 11, 2021

This worked for me as well:

cmake -DGLIBCXX_USE_CXX11_ABI=ON ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants