building opencv 2.4.6 on Mac - Mavericks

前端 未结 2 2009
慢半拍i
慢半拍i 2021-02-10 18:51

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 M         


        
相关标签:
2条回答
  • 2021-02-10 19:21

    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 ..
    
    0 讨论(0)
  • 2021-02-10 19:38

    It's strange, the bug hase already been reported! http://code.opencv.org/issues/3179

    And have already been solved: https://github.com/Itseez/opencv/pull/1244


    Still - for a quick solution:

    • Open up the

    [...]opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp

    • Edit around line 480:

    with the following:

    #if defined(_MSC_VER) && (_MSC_VER <= 1400)
    #define CV_PERF_TEST_MAIN_INTERNALS_ARGS(...)  \
       while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/
    #else
    #define CV_PERF_TEST_MAIN_INTERNALS_ARGS(...)  \
       __VA_ARGS__;
    #endif
    #define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...)  \
       CV_PERF_TEST_MAIN_INTERNALS_ARGS(__VA_ARGS__) \'
    

    instead of:

    #define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...) \
      while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/\
    
    • Its more or less this change on git:

    https://github.com/vkocheganov/opencv/commit/e4b201be25ff92e930b979098e94a89368677313

    • Worked for me :-)
    0 讨论(0)
提交回复
热议问题