3

我对在我的 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

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

非常感谢你:)

4

2 回答 2

4

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

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

于 2013-10-16T06:17:41.433 回答
3

you could just skip the performance tests for now. (you can always build them later, once this got solved)

add:

-D BUILD_PERF_TESTS=OFF

to your cmake cmdline

[edit]

looks you're having issues #3191 and 3179

both of them are fixed in 2.4 now https://github.com/Itseez/opencv/pull/1228 , https://github.com/Itseez/opencv/pull/1244

when did you download the code ? might consider getting a fresh copy ?

于 2013-09-02T18:40:21.540 回答