macos – 失败安装:Mac OS X Mountain Lion上的OpenCV 2.4.6.1

我对在我的MacBook Pro Mountain Lion上安装OpenCV 2.4.6.1感到很沮丧,我已经尝试了很多使用MacPort,CMake,Cuda的方法无济于事.

我按照此站点http://sadeepj.blogspot.sg/2012/03/installing-and-configuring-opencv-to.html的说明在MacOS X中安装和配置OpenCV.但是,当我在命令行’$make’中运行时,它总是导致[30%]的错误.

    [ 30%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o
/Users/yonasstephen/Downloads/opencv-2.4.6/modules/core/perf/perf_main.cpp:3:1: error: multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(core)
^~~~~~~~~~~~~~~~~~~~~~~
/Users/yonasstephen/Downloads/opencv-2.4.6/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/yonasstephen/Downloads/opencv-2.4.6/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 construction is needed for VS 2005*/\
           ^          ~~
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: *** [all] Error 2

有谁知道如何解决这个问题?

非常感谢你提前:)

最佳答案
我已经想出如何解决这个问题并将其发布在这里:https://sites.google.com/site/yonasstephenfyp2013/updates/tutorialinstallingopencvonmacosxmountainlion

解决这个问题的本质是使用正确版本的OpenCV.在我安装的时候,稳定版本是OpenCV 2.4.3.不要使用最新版本,因为它可能与新的MacOS OS兼容

转载注明原文:macos – 失败安装:Mac OS X Mountain Lion上的OpenCV 2.4.6.1 - 代码日志