我想在 OpenCV 中使用 BRIEF 和 ORB,为了在 OpenCV 中使用 SSE4.2(加速匹配),我们需要在 gcc 4.3 或更高版本并启用 SSE4.2 选项的情况下编译 OpenCV。
我用 gcc4.2.1 编译 OpenCV 没有问题,这是我的 Mac OS X 10.6.8 中的默认版本。
然后,我尝试使用 Macports 安装 gcc4.3、4.4、4.5、4.6、4.7、4.8 并将 gcc 切换到新的。我首先尝试使用默认设置(如 OpenCV 网站中的说明)安装 OpenCV。但是我无法像使用 gcc4.2.1 时那样编译代码。请注意,gcc4.2.1 没有问题。gcc4.3 或更高版本会出现问题。
您能否给我一个建议,问题出在哪里?似乎错误来自编译器兼容性。
一些错误是:
OpenCV-2.4.0/modules/highgui/src/window_cocoa.mm: In function 'void cvDestroyAllWindows()':
OpenCV-2.4.0/modules/highgui/src/window_cocoa.mm:198:21: error: expected ';' before 'in'
OpenCV-2.4.0/modules/highgui/src/window_cocoa.mm:198:21: error: 'in' was not declared in this scope
OpenCV-2.4.0/modules/highgui/src/window_cocoa.mm:198:24: error: expected ';' before 'list'
In file included from /opt/local/include/libavformat/avformat.h:42:0,
from OpenCV-2.4.0/modules/highgui/src/ffmpeg_codecs.hpp:78,
from OpenCV-2.4.0/modules/highgui/src/cap_ffmpeg_impl.hpp:56,
from OpenCV-2.4.0/modules/highgui/src/cap_ffmpeg.cpp:45:
/opt/local/include/libavcodec/avcodec.h:554:1: internal compiler error: Segmentation fault
Please submit a full bug report,