3

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

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(我删除了以前的安装)时,我收到了类似的错误

有什么想法吗?

4

1 回答 1

3

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

于 2013-01-26T07:59:58.473 回答