0
$\begingroup$

Rosanswers logo

I am trying to create a node that will help me take an ROS Image and convert it to an OpenCV image. I am following the "Converting between ROS images and OpenCV images" tutorial. At step 9, I have created a cakin package with the required dependencies. When I paste the code given in the tutorial, and catkin_make, I get a ton of errors of style "... undefined reference to..." (this is a truncated example of my errors)

td::char_traits<char>, std::allocator<char> > const&, unsigned int, bool)'
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x799): undefined reference to `cv::namedWindow(cv::String const&, int)'
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x7a1): undefined reference to `cv::String::deallocate()'
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x7e6): undefined reference to `ros::NodeHandle::getParam(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const'
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x841): undefined reference to `cv::String::allocate(unsigned long)'
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0xab3): undefined reference to `ros::NodeHandle::~NodeHandle()'
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0xb48): undefined reference to `image_transport::ImageTransport::~ImageTransport()'
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0xb50): undefined reference to `ros::NodeHandle::~NodeHandle()'
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0xb68): undefined reference to `ros::NodeHandle::~NodeHandle()'
image_converter.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0xc78): undefined reference to `cv::String::deallocate()'
CMakeFiles/adam_face_detect_node.dir/src/image_converter.cpp.o: In function `main':

but I have checked and all of those included libraries exist in /usr/include, as well as other locations. What is the problem?


Originally posted by ateator1 on ROS Answers with karma: 18 on 2016-12-16

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Assuming you have the libraries installed, which I think is likely you need to make sure to link your node against all those libraries in you CMakeLists.txt

If you edit your question to include your CMakeLIsts.txt we might be able to help you more.


Originally posted by tfoote with karma: 58457 on 2017-01-22

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by ateator1 on 2017-02-02:
This was a downloaded package that I had working before without any changes. Maybe I downloaded the wrong version. Checking now..

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.