ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You have this in your CMakeLists.txt
:
[..]
project(mav_recv)
[..]
catkin_package(
[..]
LIBRARIES ${PROJECT_NAME}
[..]
)
[..]
add_library(mav_recv_lib src/mav_recv.cpp)
[..]
Note how you export a library target with LIBRARIES ${PROJECT_NAME}
(where ${PROJECT_NAME}
would be replaced with mav_recv
), but then don't actually have any library target with that name.
The only library you create in this build script is mav_recv_lib
.
You'll either have to change the name of the library to ${PROJECT_NAME}
, or change the exported target name to mav_recv_lib
.
So this should work (for mav_recv
, but it would be similar for your other package):
catkin_package(
[..]
LIBRARIES mav_recv_lib
[..]
)
Note that gimbal_control
has the exact same problem.
2 | No.2 Revision |
You have this in your CMakeLists.txt
:
[..]
project(mav_recv)
[..]
catkin_package(
[..]
LIBRARIES ${PROJECT_NAME}
[..]
)
[..]
add_library(mav_recv_lib src/mav_recv.cpp)
[..]
Note how you export a library target with LIBRARIES ${PROJECT_NAME}
(where ${PROJECT_NAME}
would be replaced with mav_recv
), but then don't actually have any library target with that name.
The only library you create in this build script is mav_recv_lib
.
You'll either have to change the name of the library to ${PROJECT_NAME}
, or change the exported target name to mav_recv_lib
.
So this should work (for mav_recv
, but it would be similar for your other package):
catkin_package(
[..]
LIBRARIES mav_recv_lib
[..]
)
Note that gimbal_control
has the exact same problem.
You may be interested in fkie/catkin_lint which is a tool capable of parsing your package manifests and build scripts and checking them for common errors and bad practices.
3 | No.3 Revision |
You have this in your CMakeLists.txt
:
[..]
project(mav_recv)
[..]
catkin_package(
[..]
LIBRARIES ${PROJECT_NAME}
[..]
)
[..]
add_library(mav_recv_lib src/mav_recv.cpp)
[..]
Note how you export a library target with LIBRARIES ${PROJECT_NAME}
(where ${PROJECT_NAME}
would be replaced with mav_recv
), but then don't actually have any library target with that name.
The only library you create in this build script is mav_recv_lib
.
You'll either have to change the name of the library to ${PROJECT_NAME}
, or change the exported target name to mav_recv_lib
.
So this should work (for mav_recv
, but it would be similar for your other package):
catkin_package(
[..]
LIBRARIES mav_recv_lib
[..]
)
Note that gimbal_control
has the exact same problem.
You may be interested in fkie/catkin_lint which is a tool capable of parsing your package manifests and build scripts and checking them for common errors and bad practices.
Finally:
It seems that the find_library() function is unable to locate my packages in the current workspace, while it does find packages in the ROS workspace (I've installed ROS from source in ros_catkin_ws).
I've included both ROS workspaces in the /.bashrc file.
Please be aware that source
ing multiple workspaces may not do what you expect, as by default, source
ing a second workspace will overwrite the environment variables of the first. If ros_catkin_ws
is actually an underlay, then it would work, but in that case there would be no need to source
ros_catkin_ws
, as it would be automatically source
d as part of your "current workspace".