ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello kurisu,

If you have a library you have to add the paths and the name of the library in your CMakeLists.txt and also all cpp or hpp files.

  • #directory where the library file is in
  • link_directories(/home/path/to/library)
  • #add the cpp files of your project
  • rosbuild_add_executable(testProject src/testProject.cpp src/sonar_interface.cpp src/serial_port.hpp ...
  • #link the library to the project (name of lib file: libtestlibrary.so.2.5.2
  • target_link_libraries (testProject testlibrary)

As you can see the library is written without the pre-string "lib" and without the version number and type at the end.

Best regards, zumili