openCV犯错误

时间:2013-01-25 07:37:16

标签: c++ opencv makefile

我一直试图在最近发布的openCV(2.4.3)上运行make,但我遇到了问题。我在openCV目录中创建了一个build文件夹,并运行了以下命令:

cmake -G "Unix Makefiles" ..
make -js 

我收到以下错误:

Linking CXX shared library ../../lib/libopencv_highgui.dylib
[ 35%] Building CXX object modules/video/CMakeFiles/opencv_video.dir/src/bgfg_gaussmix.cpp.o
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:
     _modplug_read_packet in libavformat.a(libmodplug.o)
  "_ModPlug_GetCurrentTempo", referenced from:
     _modplug_read_packet in libavformat.a(libmodplug.o)
  "_ModPlug_GetLength", referenced from:
     _modplug_read_header in libavformat.a(libmodplug.o)
  "_ModPlug_GetMessage", referenced from:
     _modplug_read_header in libavformat.a(libmodplug.o)
  "_ModPlug_GetName", referenced from:
     _modplug_read_header in libavformat.a(libmodplug.o)

还有更多,但其余信息与此类似。 看起来链接器在使用highgui时遇到了困难。

当我尝试使用XCode运行代码时,我(以某种方式奇迹般地)安装了openCV(我删除了以前的安装)时,我收到了类似的错误

有什么想法吗?

1 个答案:

答案 0 :(得分:3)

我不知道这个特殊问题的原因。但是,我找到了适用于我的情况的解决方法。我禁用了ffmpeg,似乎编译好了。我清理了我的构建目录并使用选项-DWITH_FFMPEG = OFF

运行cmake