Failed to process package 'opencv2'
Dear All,
I am trying to install ROS hydro to mac os x 10.9.3 mavericks using desktop-install configuration. I am following the instructions of Homebrew.
Package dependences were resolved successfully. I used
sudo ./src/catkin/bin/catkin_make_isolated --install-space /opt/ros/hydro --install -DCMAKE_BUILD_TYPE=Release
to put files to the same place as Ubuntu, the one I am using on another PC. However, I met this message and failed:
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_cocoa.mm.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /System/Library/Frameworks/QTKit.framework/Headers/QTKit.h:51:0,
from /Users/Altrouge/ros_catkin_ws/src/opencv2/modules/highgui/src/cap_qtkit.mm:34:
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:123:46: error: expected ')' before '(' token
- (void)modernizeWithCompletionHandler:(void (^)(void))handler AVAILABLE_QTKIT_VERSION_7_7_3_AND_LATER;
^
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:123:46: error: expected identifier before '(' token
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:123:46: error: expected ';' before '(' token
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:156:18: error: unknown property attribute before ',' token
@property (atomic, readonly) NSError * error AVAILABLE_QTKIT_VERSION_7_7_3_AND_LATER;
^
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:156:18: error: expected ')' before ',' token
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:156:1: note: 'assign' can be unsafe for Objective-C objects; please state explicitly if you need it
@property (atomic, readonly) NSError * error AVAILABLE_QTKIT_VERSION_7_7_3_AND_LATER;
^
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:162:18: error: unknown property attribute before ',' token
@property (atomic, assign) QTMovieModernizerStatus status AVAILABLE_QTKIT_VERSION_7_7_3_AND_LATER;
^
/System/Library/Frameworks/QTKit.framework/Headers/QTMovieModernizer.h:162:18: error: expected ')' before ',' token
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_qtkit.mm.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX shared library ../../lib/libopencv_photo.dylib
[ 55%] Built target opencv_photo
make: *** [all] Error 2
<== Failed to process package 'opencv2':
Command '/opt/ros/hydro/env.sh make -j4 -l4' returned non-zero exit status 2
Reproduce this error by running:
==> cd /Users/Altrouge/ros_catkin_ws/build_isolated/opencv2 && /opt/ros/hydro/env.sh make -j4 -l4
Command failed, exiting.
I am wondering which part is wrong. Thank you.
Hello. After lots of googles, I found there are two ways to solve the problem. 1. downgrade opencv and gcc by brew <--- tested, problem remained. 2. use clang to compile opencv <---- not tested yet. The building command is automatic. How can I specify cmake just for this package? Thanks
I am facing the same problem. I disabled QTKit in the CMakeLists.txt but it doesn't solve the problem. Did you find a solution?
Not yet. I find some info that might be useful but do not know how to modify CMakeList.txt: 'The issue is that .... is an Objective-C 2 construct and is compiled as Objective-C++. ... You'll have to try the clang compiler. '
I finally buit opencv by doing $ export CC=/usr/bin/clang $ export CXX=/usr/bin/clang++ Now having a problem to build orocos_kdl
Thank you! Although I still have this problem ... btw will this change the building environment of the whole ros packages or just that of opencv2 ?
Did you guys find an answer for this? Might be helpful for people like me
I succeed by setting $ export CC=/usr/bin/clang $ export CXX=/usr/bin/clang++ and use $ sudo ./src/catkin/bin/catkin_make_isolated --install-space /opt/ros/hydro --install -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++. And now orocos_kdl failed.