本文介绍了OpenCV的建设2.4.6在Mac上 - 小牛的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我下载的Mac OSX(小牛)。 Untared tar文件并提出了以下:
OpenCV的CD-2.4.6.1 /
MKDIR构建
CD编译/
cmake的-GUnix的Makefile文件..
使-j8
但是我得到生成错误
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/core/perf/perf_main.cpp:3:1:错误:
多unsequenced修改ARGC[-Werror,-Wunsequenced]
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/imgproc/perf/perf_main.cpp:3:1:错误:
多unsequenced修改ARGC[-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(核心)
^ ~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5:注意:
从宏观'CV_PERF_TEST_MAIN'扩大
CV_PERF_TEST_MAIN_INTERNALS(MODULENAME,plain_only,__VA_ARGS __)\\
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12:注意:
从宏观'CV_PERF_TEST_MAIN_INTERNALS'扩大
而(++ ARGC> =(--argc,-1)){__VA_ARGS__;打破;} / *这个丑陋的构造...
^ ~~
CV_PERF_TEST_MAIN(imgproc)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5:注意:
从宏观'CV_PERF_TEST_MAIN'扩大
CV_PERF_TEST_MAIN_INTERNALS(MODULENAME,plain_only,__VA_ARGS __)\\
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12:注意:
从宏观'CV_PERF_TEST_MAIN_INTERNALS'扩大
而(++ ARGC> =(--argc,-1)){__VA_ARGS__;打破;} / *这个丑陋的构造...
^ ~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/highgui/perf/perf_main.cpp:3:1:错误:
多unsequenced修改ARGC[-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(highgui)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5:注意:
从宏观'CV_PERF_TEST_MAIN'扩大
CV_PERF_TEST_MAIN_INTERNALS(MODULENAME,plain_only,__VA_ARGS __)\\
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12:注意:
从宏观'CV_PERF_TEST_MAIN_INTERNALS'扩大
而(++ ARGC> =(--argc,-1)){__VA_ARGS__;打破;} / *这个丑陋的构造...
^ ~~
产生1个错误。
产生1个错误。
使[2]:*** [模块/核心/ CMakeFiles / opencv_perf_core.dir / PERF / perf_main.cpp.o]错误1
使[1]:*** [模块/核心/ CMakeFiles / opencv_perf_core.dir /全部]错误2
使[1]:***等待未完成的工作....
使[2]:*** [模块/ highgui / CMakeFiles / opencv_perf_highgui.dir / PERF / perf_main.cpp.o]错误1
使[2]:***等待未完成的工作....
产生1个错误。
使[2]:*** [模块/ imgproc / CMakeFiles / opencv_perf_imgproc.dir / PERF / perf_main.cpp.o]错误1
使[1]:*** [模块/ imgproc / CMakeFiles / opencv_perf_imgproc.dir /全部]错误2
[50%] [50%] [50%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_perf_highgui.dir / PERF / perf_ precomp.cpp.o
大厦CXX对象模块/ features2d / CMakeFiles / opencv_perf_features2d.dir / PERF / perf_fast.cpp.o
大厦CXX对象模块/ features2d / CMakeFiles / opencv_test_features2d.dir /测试/ test_descriptors_regression.cpp.o
[50%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_test_features2d.dir /测试/ test_detectors_regression.cpp.o
[50%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_test_highgui.dir /测试/ test_ffmpeg.cpp.o
[50%]大厦CXX对象模块/ calib3d / CMakeFiles / opencv_perf_calib3d.dir / PERF / perf_main.cpp.o
[50%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_perf_features2d.dir / PERF / perf_main.cpp.o
使[1]:*** [模块/ highgui / CMakeFiles / opencv_perf_highgui.dir /全部]错误2
[50%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_test_features2d.dir /测试/ test_fast.cpp.o
[50%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_test_highgui.dir /测试/ test_fourcc.cpp.o
[50%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_perf_features2d.dir / PERF / perf_orb.cpp.o
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/calib3d/perf/perf_main.cpp:3:1:错误:
多unsequenced修改ARGC[-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(calib3d)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5:注意:
从宏观'CV_PERF_TEST_MAIN'扩大
CV_PERF_TEST_MAIN_INTERNALS(MODULENAME,plain_only,__VA_ARGS __)\\
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12:注意:
从宏观'CV_PERF_TEST_MAIN_INTERNALS'扩大
而(++ ARGC> =(--argc,-1)){__VA_ARGS__;打破;} / *这个丑陋的构造...
^ ~~
[50%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_test_features2d.dir /测试/ test_keypoints.cpp.o
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/features2d/perf/perf_main.cpp:3:1:错误:
多unsequenced修改ARGC[-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(features2d)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5:注意:
从宏观'CV_PERF_TEST_MAIN'扩大
CV_PERF_TEST_MAIN_INTERNALS(MODULENAME,plain_only,__VA_ARGS __)\\
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12:注意:
从宏观'CV_PERF_TEST_MAIN_INTERNALS'扩大
而(++ ARGC> =(--argc,-1)){__VA_ARGS__;打破;} / *这个丑陋的构造...
^ ~~
产生1个错误。
使[2]:*** [模块/ calib3d / CMakeFiles / opencv_perf_calib3d.dir / PERF / perf_main.cpp.o]错误1
使[1]:*** [模块/ calib3d / CMakeFiles / opencv_perf_calib3d.dir /全部]错误2
[50%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_perf_features2d.dir / PERF / perf_ precomp.cpp.o
产生1个错误。
使[2]:*** [模块/ features2d / CMakeFiles / opencv_perf_features2d.dir / PERF / perf_main.cpp.o]错误1
使[2]:***等待未完成的工作....
[51%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_test_highgui.dir /测试/ test_framecount.cpp.o
[51%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_test_features2d.dir /测试/ test_main.cpp.o
[51%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_test_highgui.dir /测试/ test_grfmt.cpp.o
[51%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_test_highgui.dir /测试/ test_gui.cpp.o
[51%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_test_features2d.dir /测试/ test_matchers_algorithmic.cpp.o
[51%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_test_highgui.dir /测试/ test_main.cpp.o
[51%] [52%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_test_highgui.dir /测试/ test_positioning.cpp.o
大厦CXX对象模块/ features2d / CMakeFiles / opencv_test_features2d.dir /测试/ test_mser.cpp.o
[52%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_test_highgui.dir /测试/ TEST_ precomp.cpp.o
[52%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_test_highgui.dir /测试/ test_video_io.cpp.o
使[1]:*** [模块/ features2d / CMakeFiles / opencv_perf_features2d.dir /全部]错误2
[52%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_test_features2d.dir /测试/ test_nearestneighbors.cpp.o
[52%]大厦CXX对象模块/ highgui / CMakeFiles / opencv_test_highgui.dir /测试/ test_video_pos.cpp.o
[52%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_test_features2d.dir /测试/ test_orb.cpp.o
[52%]大厦CXX对象模块/ features2d / CMakeFiles / opencv_test_features2d.dir /测试/ TEST_ precomp.cpp.o
[52%]大厦CXX对象modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_rotation_and_scale_invariance.cpp.o
链接CXX可执行../../bin/opencv_test_highgui
[52%]内置目标opencv_test_highgui
链接CXX可执行../../bin/opencv_test_features2d
[52%]内置目标opencv_test_features2d
使:*** [全部]错误2
解决方案
我用cmake的此编译选项:
cmake的-GUnix的Makefile文件-D CMAKE_INSTALL_ preFIX = /用户/ produit /库/开发商/ OpenCV的/ -D CMAKE_OSX_ARCHITECTURES = x86_64的-D BUILD_PERF_TESTS = OFF -D BUILD_opencv_legacy = NO。
I downloaded opencv 2.4.6 for mac OSX (Mavericks). Untared the tar file and made the following steps:
cd opencv-2.4.6.1/
mkdir build
cd build/
cmake -G "Unix Makefiles" ..
make -j8
But I get an error on the build
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/core/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/imgproc/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(core)
^~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
CV_PERF_TEST_MAIN(imgproc)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/highgui/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(highgui)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
1 error generated.
1 error generated.
make[2]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [modules/highgui/CMakeFiles/opencv_perf_highgui.dir/perf/perf_main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [modules/imgproc/CMakeFiles/opencv_perf_imgproc.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/imgproc/CMakeFiles/opencv_perf_imgproc.dir/all] Error 2
[ 50%] [ 50%] [ 50%] Building CXX object modules/highgui/CMakeFiles/opencv_perf_highgui.dir/perf/perf_precomp.cpp.o
Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_fast.cpp.o
Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_descriptors_regression.cpp.o
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_detectors_regression.cpp.o
[ 50%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_ffmpeg.cpp.o
[ 50%] Building CXX object modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/perf/perf_main.cpp.o
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_main.cpp.o
make[1]: *** [modules/highgui/CMakeFiles/opencv_perf_highgui.dir/all] Error 2
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_fast.cpp.o
[ 50%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_fourcc.cpp.o
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_orb.cpp.o
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/calib3d/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(calib3d)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_keypoints.cpp.o
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/features2d/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(features2d)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
1 error generated.
make[2]: *** [modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/all] Error 2
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_precomp.cpp.o
1 error generated.
make[2]: *** [modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_framecount.cpp.o
[ 51%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_main.cpp.o
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_grfmt.cpp.o
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_gui.cpp.o
[ 51%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_matchers_algorithmic.cpp.o
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_main.cpp.o
[ 51%] [ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_positioning.cpp.o
Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_mser.cpp.o
[ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_precomp.cpp.o
[ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_video_io.cpp.o
make[1]: *** [modules/features2d/CMakeFiles/opencv_perf_features2d.dir/all] Error 2
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_nearestneighbors.cpp.o
[ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_video_pos.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_orb.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_precomp.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_rotation_and_scale_invariance.cpp.o
Linking CXX executable ../../bin/opencv_test_highgui
[ 52%] Built target opencv_test_highgui
Linking CXX executable ../../bin/opencv_test_features2d
[ 52%] Built target opencv_test_features2d
make: *** [all] Error 2
解决方案
I used this compilation options for cmake:cmake -G "Unix Makefiles" -D CMAKE_INSTALL_PREFIX=/Users/produit/Library/Developer/opencv/ -D CMAKE_OSX_ARCHITECTURES=x86_64 -D BUILD_PERF_TESTS=OFF -D BUILD_opencv_legacy=NO ..
这篇关于OpenCV的建设2.4.6在Mac上 - 小牛的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!