kalectro / openni2_camera

Access Kinect ASUS Xtion and other OpenNI cameras using OpenNI2 and publish streams via ROS image_transport
3 stars 6 forks source link

linker problem on hydro #3

Open MalcolmMielle opened 10 years ago

MalcolmMielle commented 10 years ago

Hey,

I'm trying to use your rep on raspberry pi with hydro. So I've instaled openni2 from your other repo and I have opencv2 and openCV as a third party AND from source.

I was wondering if your repo depended on the third party or external libraries (technically that would be libopencv on Ubuntu). Because when I try to compile openni2_camera I have

/usr/bin/ld: warning: libopencv_calib3d.so.3.0, needed by         /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
CMakeFiles/openni2_camera_node.dir/src/openni2_camera.cpp.o: In function `cv::Mat::~Mat()':
openni2_camera.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x3c): undefined reference to `cv::fastFree(void*)'
CMakeFiles/openni2_camera_node.dir/src/openni2_camera.cpp.o: In function `cv::Mat::operator=(cv::Mat const&)':
openni2_camera.cpp:(.text._ZN2cv3MataSERKS0_[cv::Mat::operator=(cv::Mat const&)]+0x12c): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
CMakeFiles/openni2_camera_node.dir/src/openni2_camera.cpp.o: In function `cv::Mat::release()':
openni2_camera.cpp:(.text._ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x58): undefined reference to `cv::Mat::deallocate()'
/home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
/home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
/home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so: undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
/home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
/home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so: undefined reference to `cv::Mat::convertTo(cv::_OutputArray const&, int, double, double) const'
collect2: ld returned 1 exit status
make[2]: ***     [/home/pi/tobot_ws/catkin_ws2/devel/lib/openni2_camera/openni2_camera_node] Error 1

If I don't have have the source installed and I have only :

/usr/bin/ld: note: 'cv::Mat::copySize(cv::Mat const&)' is defined in DSO         
/usr/local/lib/libopencv_core.so.3.0 so try adding it to the linker command line
/usr/local/lib/libopencv_core.so.3.0: could not read symbols: Invalid operation

if I have both the third party and the source install. I just don't know what went wrong with the linkers in both cases...

Thanks a lot !

EDIT :

I managed to compile by adding OpenCV linker in your CMakeList.txt (want me to pull it ?). Anyways, I just needed those linkers.

kalectro commented 10 years ago

sorry for the late response, please send a pull request and I will merge it. Thank you