0
$\begingroup$

Rosanswers logo

Hello! I have simple subscriber project, but there some problems. I'm using Ubuntu 11.04 2.6.38-11-generic, gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4), GNU ld (GNU Binutils for Ubuntu) 2.21.0.20110327 and GNU Make 3.81. I have

  1. /project/include/DepthListener.h,
  2. /project/src/DepthListener.cpp,
  3. /project/src/depthConverter.cpp.

When I try to make project, I receive next errors:

CMakeFiles/depthListener.dir/src/depthListener.o: In function `main':
/ros/depthListen/src/depthListener.cpp:6: undefined reference to `DepthConverter::DepthConverter()'
/ros/depthListen/src/depthListener.cpp:6: undefined reference to `DepthConverter::~DepthConverter()'
/ros/depthListen/src/depthListener.cpp:6: undefined reference to `DepthConverter::~DepthConverter()'
collect2: ld returned 1 exit status

As I undestand, make does not see DepthListener.cpp file and problem somewhere in CMakeLists.txt.

There are all files:

  1. DepthConverter.h

  2. CMakeLists.txt

  3. DepthConverter.cpp

  4. depthListener

Thanks for help!


Originally posted by CaptainTrunky on ROS Answers with karma: 546 on 2011-10-14

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I looked briefly at your CMakeLists, I think this should fix it:

rosbuild_add_executable(depthListener src/depthListener.cpp 
                                      src/depthConverter.cpp)

Originally posted by Ivan Dryanovski with karma: 4954 on 2011-10-15

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by CaptainTrunky on 2011-10-15:
Thanks, it works fine! So silly mistake.

$\endgroup$

Your Answer

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