ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
In addition to what @William posted, some other comments:
include_directories(include ${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
anywhere, which could also be responsible for the not declared
error.find_package(OpenCV)
once, the results get cached. Also, I'd add a REQUIRED
to that, as your code can't compile without OpenCV being available.my_publisher
target to multiple (sets of) libraries with a single target_link_libraries(..)
invocation. Just do: target_link_libraries(my_publisher ${OpenCV_LIBS} ${catkin_LIBRARIES})
.image_transport_tutorial_cpp
(from add_dependencies(my_subscriber image_transport_tutorial_cpp)
) an actual target from image_transport
? Perhaps you meant image_transport_tutorial_gencpp
(which is deprecated, afaik)?Minor things, but they make your CMakeLists.txt
a bit easier to read and maintain.
2 | No.2 Revision |
In addition to what @William posted, some other comments:
include_directories(include ${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})${catkin_INCLUDE_DIRS})
not declared
error.find_package(OpenCV)
once, the results get cached. Also, I'd add a REQUIRED
to that, as your code can't compile without OpenCV being available.my_publisher
target to multiple (sets of) libraries with a single target_link_libraries(..)
invocation. Just target_link_libraries(my_publisher ${OpenCV_LIBS} ${catkin_LIBRARIES})${catkin_LIBRARIES})
image_transport_tutorial_cpp
(from add_dependencies(my_subscriber image_transport_tutorial_cpp)..)
) an actual target from image_transport
? Perhaps you meant image_transport_tutorial_gencpp
(which is deprecated, afaik)?Minor things, but they make your CMakeLists.txt
a bit easier to read and maintain.
3 | No.3 Revision |
In addition to what @William posted, some other comments:
perhaps it wasn't copy/pasted, but I don't see an
include_directories(include ${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
anywhere, which could also be responsible for the not declared
error.
find_package(OpenCV)
once, the results get cached. Also, I'd add a REQUIRED
to that, as your code can't compile without OpenCV being available.you can link your targets to multiple (sets of) libraries with a single my_publisher
target target_link_libraries(..)
invocation. Just do:
target_link_libraries(my_publisher ${OpenCV_LIBS} ${catkin_LIBRARIES})
for the my_publisher
target fi.
is image_transport_tutorial_cpp
(from add_dependencies(my_subscriber ..)
) an actual target from image_transport
? Perhaps you meant image_transport_tutorial_gencpp
(which is deprecated, afaik)?
Minor things, but they make your CMakeLists.txt
a bit easier to read and maintain.