1

我正在尝试在我的 MacBook 上使用 OpenCV,但在使用 cake 时遇到问题,我输入 make -j8 它似乎没有完成。我在我的 OpenCV 构建中使用这个命令。我正在使用在线指南在 Xcode 上使用 OpenCV 框架,所以如果您觉得我这样做不正确,请您推荐一个指南或告诉我如何执行此操作。

我得到的错误代码如下:

     [ 37%] Built target zlib
[ 37%] [ 37%] Built target libjpeg
Built target libjasper
[ 37%] Built target libpng
[ 37%] [ 37%] Built target libtiff
Built target opencv_core
[ 37%] [ 37%] Built target opencv_flann
Built target IlmImf
[ 37%] Built target opencv_ml
[ 37%] Built target opencv_imgproc
[ 37%] [ 37%] Built target opencv_photo
Built target opencv_video
[ 37%] Built target opencv_highgui
[ 37%] [ 37%] Built target opencv_features2d
Built target opencv_objdetect
[ 37%] Built target opencv_ts
[ 37%] Built target opencv_calib3d
[ 37%] Built target opencv_test_core
[ 37%] [ 37%] [ 37%] [ 37%] [ 37%] Building CXX object modules/imgproc/CMakeFiles/opencv_perf_imgproc.dir/perf/perf_main.cpp.o
Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_main.cpp.o
[ 37%] Building CXX object modules/highgui/CMakeFiles/opencv_perf_highgui.dir/perf/perf_main.cpp.o
Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o
Built target opencv_test_highgui
Built target opencv_test_flann
[ 37%] Built target opencv_test_imgproc
[ 37%] [ 37%] Building CXX object modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/perf/perf_main.cpp.o
Scanning dependencies of target opencv_test_ml
Built target opencv_test_features2d
[ 37%] Scanning dependencies of target opencv_perf_video
Built target opencv_test_calib3d
Scanning dependencies of target opencv_test_video
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_perf_video.dir/perf/perf_main.cpp.o
[ 37%] Building CXX object modules/ml/CMakeFiles/opencv_test_ml.dir/test/test_emknearestkmeans.cpp.o
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_accum.cpp.o
/Users/taz-3456/Desktop/opencv/modules/features2d/perf/perf_main.cpp:3:1: error: 
      multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(features2d)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/taz-3456/Desktop/opencv/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/taz-3456/Desktop/opencv/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 cons...
           ^          ~~
/Users/taz-3456/Desktop/opencv/modules/imgproc/perf/perf_main.cpp:3:1: error: 
      multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(imgproc)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/taz-3456/Desktop/opencv/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/taz-3456/Desktop/opencv/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 cons...
           ^          ~~
/Users/taz-3456/Desktop/opencv/modules/core/perf/perf_main.cpp:3:1: error: 
      multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(core)
^~~~~~~~~~~~~~~~~~~~~~~
/Users/taz-3456/Desktop/opencv/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/taz-3456/Desktop/opencv/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 cons...
           ^          ~~
/Users/taz-3456/Desktop/opencv/modules/calib3d/perf/perf_main.cpp:3:1: error: 
      multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(calib3d)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/taz-3456/Desktop/opencv/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/taz-3456/Desktop/opencv/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 cons...
           ^          ~~
/Users/taz-3456/Desktop/opencv/modules/highgui/perf/perf_main.cpp:3:1: error: 
      multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(highgui)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/taz-3456/Desktop/opencv/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/taz-3456/Desktop/opencv/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 cons...
           ^          ~~
/Users/taz-3456/Desktop/opencv/modules/video/perf/perf_main.cpp:3:1: error: 
      multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(video)
^~~~~~~~~~~~~~~~~~~~~~~~
/Users/taz-3456/Desktop/opencv/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/taz-3456/Desktop/opencv/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 cons...
           ^          ~~
1 error generated.
make[2]: *** [modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/features2d/CMakeFiles/opencv_perf_features2d.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 37%] 1 error generated.
Building CXX object modules/video/CMakeFiles/opencv_perf_video.dir/perf/perf_optflowpyrlk.cpp.o
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
1 error generated.
[ 37%] 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
Building CXX object modules/ml/CMakeFiles/opencv_test_ml.dir/test/test_gbttest.cpp.o
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_backgroundsubtractor_gbh.cpp.o
1 error generated.
1 error generated.
make[2]: *** [modules/highgui/CMakeFiles/opencv_perf_highgui.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_perf_highgui.dir/all] Error 2
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
[ 37%] [ 37%] Building CXX object modules/video/CMakeFiles/opencv_perf_video.dir/perf/perf_precomp.cpp.o
Building CXX object modules/ml/CMakeFiles/opencv_test_ml.dir/test/test_main.cpp.o
1 error generated.
make[2]: *** [modules/video/CMakeFiles/opencv_perf_video.dir/perf/perf_main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_camshift.cpp.o
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_estimaterigid.cpp.o
[ 37%] Building CXX object modules/ml/CMakeFiles/opencv_test_ml.dir/test/test_mltests.cpp.o
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_kalman.cpp.o
[ 37%] Building CXX object modules/ml/CMakeFiles/opencv_test_ml.dir/test/test_mltests2.cpp.o
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_main.cpp.o
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_motiontemplates.cpp.o
[ 37%] Building CXX object modules/ml/CMakeFiles/opencv_test_ml.dir/test/test_precomp.cpp.o
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_optflowpyrlk.cpp.o
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_precomp.cpp.o
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_simpleflow.cpp.o
[ 37%] Building CXX object modules/video/CMakeFiles/opencv_test_video.dir/test/test_tvl1optflow.cpp.o
[ 37%] Building CXX object modules/ml/CMakeFiles/opencv_test_ml.dir/test/test_save_load.cpp.o
make[1]: *** [modules/video/CMakeFiles/opencv_perf_video.dir/all] Error 2
Linking CXX executable ../../bin/opencv_test_video
Linking CXX executable ../../bin/opencv_test_ml
[ 37%] [ 37%] Built target opencv_test_video
Built target opencv_test_ml
make: *** [all] Error 2

谁能告诉我我做错了什么?请注意我正在遵循本指南:http ://tilomitra.com/opencv-on-mac-osx/

4

1 回答 1

2

   while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly cons...
          ^          ~~
/Users/taz-3456/Desktop/opencv/modules/imgproc/perf/perf_main.cpp:3:1: error: 
  multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(imgproc)

看起来像一个 OpenCV 错误,您应该向上游报告。

这是因为使用增量/减量运算符修改变量具有未定义的评估顺序。

于 2013-11-05T17:36:53.297 回答