ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Building Components from CLion doesn't work

asked 2019-07-04 06:22:48 -0600

madmax gravatar image

I am trying to build the composition demo package with CLion, but I always get linking errors.

When I build from shell, it works out of the box.
I am running CLion from the same shell where the shell build worked.

undefined reference to `class_loader::ClassLoader::ClassLoader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'  
CMakeFiles/dlopen_composition.dir/src/dlopen_composition.cpp.o: In function `std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > class_loader::impl::getAvailableClasses<rclcpp_components::NodeFactory>(class_loader::ClassLoader const*)':
/opt/ros/dashing/include/class_loader/class_loader_core.hpp:310: undefined reference to `class_loader::impl::getPluginBaseToFactoryMapMapMutex()'  
/opt/ros/dashing/include/class_loader/class_loader_core.hpp:318: undefined reference to `class_loader::impl::AbstractMetaObjectBase::isOwnedBy(class_loader::ClassLoader const*) const'  
/opt/ros/dashing/include/class_loader/class_loader_core.hpp:320: undefined reference to `class_loader::impl::AbstractMetaObjectBase::isOwnedBy(class_loader::ClassLoader const*) const'  
CMakeFiles/dlopen_composition.dir/src/dlopen_composition.cpp.o: In function `rclcpp_components::NodeFactory* class_loader::ClassLoader::createRawInstance<rclcpp_components::NodeFactory>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':  
/opt/ros/dashing/include/class_loader/class_loader.hpp:280: undefined reference to `class_loader::ClassLoader::setUnmanagedInstanceBeenCreated(bool)'

CLion cmake output:

- Found ament_cmake: 0.7.3 (/opt/ros/dashing/share/ament_cmake/cmake)
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Found example_interfaces: 0.7.1 (/opt/ros/dashing/share/example_interfaces/cmake)
-- Found rosidl_adapter: 0.7.4 (/opt/ros/dashing/share/rosidl_adapter/cmake)
-- Found rclcpp: 0.7.6 (/opt/ros/dashing/share/rclcpp/cmake)
-- Found rmw_implementation_cmake: 0.7.2 (/opt/ros/dashing/share/rmw_implementation_cmake/cmake)
-- Found rclcpp_components: 0.7.6 (/opt/ros/dashing/share/rclcpp_components/cmake)
-- Found poco_vendor:  (/opt/ros/dashing/share/poco_vendor/cmake)
CMake Warning at /opt/ros/dashing/share/class_loader/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
  Package 'class_loader' exports library 'class_loader' which couldn't be
  found

I am a bit clueless where the problem might be.

edit retag flag offensive close merge delete

Comments

2

Workaround: run export CMAKE_LIBRARY_PATH="/opt/ros/dashing/lib" before running CLion.

clyde gravatar image clyde  ( 2019-07-09 23:17:11 -0600 )edit
2

I think this might be a bug in class_loader, and this should fix it https://github.com/ros/class_loader/p...

sloretz gravatar image sloretz  ( 2019-07-16 18:50:18 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-11-20 11:44:35 -0600

clyde gravatar image

I can confirm that this is fixed in Eloquent. Thanks @sloretz.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-07-04 06:22:48 -0600

Seen: 466 times

Last updated: Nov 20 '19