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

Revision history [back]

click to hide/show revision 1
initial version

target_link_libraries(prom2ROS ~/simulateur/lib/Linux/comm/libcomm_debug)

This is probably what isn't working for you. You've already specified the library search path with:

link_directories(~/simulateur/lib/Linux/comm)

target_link_libraries now needs the individual library names you want to link, without the paths. This:

target_link_libraries(prom2ROS libcomm_debug)

would probably be enough.

target_link_libraries(prom2ROS ~/simulateur/lib/Linux/comm/libcomm_debug)

This is probably what isn't working for you. You've already specified the library search path with:

link_directories(~/simulateur/lib/Linux/comm)

target_link_libraries now needs the individual library names you want to link, without the paths. This:

target_link_libraries(prom2ROS libcomm_debug)

would probably be enough.


Besides that, there some things I'd do differently:

  • don't use relative paths, they are dependent on the cwd, which is fragile
  • try to use an existing FindXXX script (or write one, in this case for the libraries and include paths of your simulator)
  • if not available / desirable / possible, try to use find_library, find_path, etc, instead of hard coding their locations

target_link_libraries(prom2ROS ~/simulateur/lib/Linux/comm/libcomm_debug)

This is probably what isn't working for you. You've already specified the library search path with:

link_directories(~/simulateur/lib/Linux/comm)

target_link_libraries now needs the individual library names you want to link, without the paths. This:

target_link_libraries(prom2ROS libcomm_debug)

would probably be enough.


Besides that, there some things I'd do differently:

  • don't use relative paths, they are dependent on the cwd, which is fragilefragile (not in this case, but in general they are)
  • try to use an existing FindXXX script (or write one, in this case for the libraries and include paths of your simulator)
  • if not available / desirable / possible, try to use find_library, find_path, etc, instead of hard coding their locations

target_link_libraries(prom2ROS ~/simulateur/lib/Linux/comm/libcomm_debug)

This is probably what isn't working for you. You've already specified the library search path with:

link_directories(~/simulateur/lib/Linux/comm)

target_link_libraries now needs the individual library names you want to link, without the paths. This:

target_link_libraries(prom2ROS libcomm_debug)comm_debug)

would probably be enough.


Besides that, there some things I'd do differently:

  • don't use relative paths, they are dependent on the cwd, which is fragile (not in this case, but in general they are)
  • try to use an existing FindXXX script (or write one, in this case for the libraries and include paths of your simulator)
  • if not available / desirable / possible, try to use find_library, find_path, etc, instead of hard coding their locations

EDIT: Oops, forgot to remove the lib prefix from the library. Updated my answer above.