我想不使用Macports来安装opencv。另外,我不希望这些文件位于local
文件夹中。我做了如下
cd opencv-2.4.8
mkdir _build _install
cd _build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=../_install ..
make
[ 34%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/bitstrm.cpp.o
Linking CXX shared library ../../lib/libopencv_highgui.dylib
Undefined symbols for architecture x86_64:
"_ModPlug_GetCurrentOrder", referenced from:
_modplug_read_packet in libavformat.a(libmodplug.o)
"_ModPlug_GetCurrentPattern", referenced from:
_modplug_read_packet in libavformat.a(libmodplug.o)
"_ModPlug_GetCurrentRow", referenced from:
_modplug_read_packet in libavformat.a(libmodplug.o)
"_ModPlug_GetCurrentSpeed", referenced from:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libopencv_highgui.2.4.8.dylib] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2
最佳答案
如果不使用ffmpeg,请安装ffmpeg或在不使用ffmpeg的情况下构建opencv。
-D WITH_FFMPEG = OFF
https://stackoverflow.com/questions/24138462/