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

foxy build error linking boost libbrary #166

Closed
zuxinrui opened this issue Mar 3, 2021 · 3 comments
Closed

foxy build error linking boost libbrary #166

zuxinrui opened this issue Mar 3, 2021 · 3 comments

Comments

@zuxinrui
Copy link

zuxinrui commented Mar 3, 2021

Platform: ubuntu 20.04 foxy
When build the package from source using ros2 branch, something wrong with linking the boost library:

--- stderr: geometric_shapes
/usr/bin/ld: CMakeFiles/test_loaded_meshes.dir/test_loaded_meshes.cpp.o: in function CompareMeshVsPrimitive::SetUp()': test_loaded_meshes.cpp:(.text._ZN22CompareMeshVsPrimitive5SetUpEv[_ZN22CompareMeshVsPrimitive5SetUpEv]+0x13f): undefined reference to boost::filesystem::path::operator/=(boost::filesystem::path const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/test_loaded_meshes.dir/build.make:158: test/test_loaded_meshes] Error 1
make[1]: *** [CMakeFiles/Makefile2:422: test/CMakeFiles/test_loaded_meshes.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: CMakeFiles/test_point_inclusion.dir/test_point_inclusion.cpp.o: in function MeshPointContainment_Pr2Forearm_Test::TestBody()': test_point_inclusion.cpp:(.text+0x710b): undefined reference to boost::filesystem::path::operator/=(boost::filesystem::path const&)'
/usr/bin/ld: CMakeFiles/test_point_inclusion.dir/test_point_inclusion.cpp.o: in function MeshPointContainment_Basic_Test::TestBody()': test_point_inclusion.cpp:(.text+0x17216): undefined reference to boost::filesystem::path::operator/=(boost::filesystem::path const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/test_point_inclusion.dir/build.make:158: test/test_point_inclusion] Error 1
make[1]: *** [CMakeFiles/Makefile2:277: test/CMakeFiles/test_point_inclusion.dir/all] Error 2
/usr/bin/ld: CMakeFiles/test_body_operations.dir/test_body_operations.cpp.o: in function Bodies_ConstructShapeFromBodyMesh_Test::TestBody()': test_body_operations.cpp:(.text+0x2346): undefined reference to boost::filesystem::path::operator/=(boost::filesystem::path const&)'
/usr/bin/ld: CMakeFiles/test_body_operations.dir/test_body_operations.cpp.o: in function Bodies_ConstructMarkerFromBodyMesh_Test::TestBody()': test_body_operations.cpp:(.text+0x341a): undefined reference to boost::filesystem::path::operator/=(boost::filesystem::path const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/test_body_operations.dir/build.make:158: test/test_body_operations] Error 1
make[1]: *** [CMakeFiles/Makefile2:480: test/CMakeFiles/test_body_operations.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

I'm not sure if this can be fixed with adjusting the Cmakelist.txt

@pvanlaar
Copy link

I tried to reproduce the issue, but I could not. I started from a clean fox-ros-base installation on Ubuntu 20.04 and cloned this repo. After that I used rosdep to install the dependencies for this package. One of the dependencies that got installed was Boost (installed as version 17, i.e. libboost1.71-dev).

Could you be missing libboost-dev on your system?

Commands you could use:

Install Boost using apt-get

sudo apt-get update -qq
sudo apt-get install libboost1.71-dev

Using rosdep to install all dependencies:

sudo rosdep init
rosdep update # no sudo

## from workspace root
rosdep install --from-paths src -y -i

@jlack1987
Copy link

Yeah I have the same issue. The reason is here. This package depends on a Boost component(filesystem) but ament_export_dependencies doesn't export the components. The trick is to add a cmake extras thing and append the target to the libraries there. I'll see if I can MR a fix.

@JafarAbdi
Copy link
Member

Should be fixed with #205

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

4 participants