Ask Your Question
0

OSX indigo opencv linking problem (cv_bridge, image_view)

asked 2015-03-26 13:54:07 -0500

Mike Shomin gravatar image

I'm trying to install indigo from source on a mac recently upgraded to yosemite (10.10). I've had a few issued but managed to build everything up to cv_bridge. cv_bridge has a linking error with opencv:

Linking CXX shared library /.../devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.so
Undefined symbols for architecture x86_64:
  "cv::Exception::Exception(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
  NumpyAllocator::allocate(int, int const*, int, int*&, unsigned char*&, unsigned char*&, unsigned long*) in module_opencv2.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/.../devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.so] Error 1
make[1]: *** [src/CMakeFiles/cv_bridge_boost.dir/all] Error 2
make: *** [all] Error 2

Based on some older answers, it looked like this was a libc++ vs libstdc++ issue ( http://answers.ros.org/question/95056... ), so after adding:

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -stdlib=libstdc++")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}  -stdlib=libstdc++")

cv_bridge compiled fine, as did everything up to image_view. image_view also had an opencv linking error:

Linking CXX executable /.../image_view/lib/image_view/disparity_view
Undefined symbols for architecture x86_64:
  "cv::imwrite(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&, std::__1::vector<int, std::__1::allocator<int> > const&)", referenced from:
... many more opencv missing symbols ...

Making the same change to CMakeLists for image_view, however, causes linking error to ros core libraries:

Linking CXX executable /.../image_view/lib/image_view/disparity_view
Undefined symbols for architecture x86_64:
  "ros::init(int&, char**, std::string const&, unsigned int)", referenced from:
  _main in disparity_view.cpp.o

I must be missing something here as it seems other people are having success with indigo on OSX. Also, just to be clear, I have opencv 2.4.5 from homebrew-science. Any help is appreciated. Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-03-26 17:12:36 -0500

Mr. CEO gravatar image

I uninstalled opencv2 and used brew install opencv --devel to get opencv 3. It got rid of the errors for that library...I am having trouble with the stereo_image_proc library though.

edit flag offensive delete link more

Comments

Thanks for the tip. Trying opencv 3 now. Seems to fix things, but also brings a new problem. image_view now complains about a missing function: /.../image_nodelet.cpp:145:35: error: use of undeclared identifier 'cvGetWindowHandle'

Mike Shomin gravatar image Mike Shomin  ( 2015-03-26 17:57:06 -0500 )edit

I fixed that...Let see what I did

Mr. CEO gravatar image Mr. CEO  ( 2015-03-26 18:13:36 -0500 )edit

This is a copy of my file. https://gist.github.com/automagically...

Mr. CEO gravatar image Mr. CEO  ( 2015-03-26 18:17:53 -0500 )edit

Gotcha, looks like you just skipped that bit if opencv3. After a little opencv 3 name change in rqt_image_view, I am now up to image_proc. Did you happen to run into a missing need for libopencv_contrib.dylib?

Mike Shomin gravatar image Mike Shomin  ( 2015-03-26 18:25:23 -0500 )edit

I dont think I did....

Mr. CEO gravatar image Mr. CEO  ( 2015-03-26 18:30:10 -0500 )edit

I assume you are doing the full install

Mr. CEO gravatar image Mr. CEO  ( 2015-03-26 18:51:11 -0500 )edit

I have decided to do the barebones and install the libraries I need. It is what I should of done in the first place. If you need help I will still attempt to help you.

Mr. CEO gravatar image Mr. CEO  ( 2015-03-26 19:02:04 -0500 )edit

I'm trying for full... but I'm having to skip some thing. I really need rviz though. Through hacking, I've gotten there. Now I'm having OGRE linking problems. Tried to install ogre 1.9 through brew, but having a problem.

Mike Shomin gravatar image Mike Shomin  ( 2015-03-26 19:49:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-03-26 13:54:07 -0500

Seen: 875 times

Last updated: Mar 26 '15