我正在尝试在Xcode中为一个项目设置OpenCV但是有一个我似乎无法解决的编译错误。
这是一个示例错误:
'opencv2/imgcodecs.hpp' file not found
其他包含文件也会出现类似错误。
我可能错了,但我认为它应该在usr/local/lib
查找所有包含文件。
我在该目录中有以下内容:
justin-macbook-pro:lib Justin$ pwd
/usr/local/lib
justin-macbook-pro:lib Justin$ ls
libopencv_calib3d.3.0.0.dylib libopencv_objdetect.3.0.dylib
libopencv_calib3d.3.0.dylib libopencv_objdetect.a
libopencv_calib3d.a libopencv_objdetect.dylib
libopencv_calib3d.dylib libopencv_photo.3.0.0.dylib
libopencv_core.3.0.0.dylib libopencv_photo.3.0.dylib
libopencv_core.3.0.dylib libopencv_photo.a
libopencv_core.a libopencv_photo.dylib
libopencv_core.dylib libopencv_shape.3.0.0.dylib
libopencv_features2d.3.0.0.dylib libopencv_shape.3.0.dylib
libopencv_features2d.3.0.dylib libopencv_shape.a
libopencv_features2d.a libopencv_shape.dylib
libopencv_features2d.dylib libopencv_stitching.3.0.0.dylib
libopencv_flann.3.0.0.dylib libopencv_stitching.3.0.dylib
libopencv_flann.3.0.dylib libopencv_stitching.a
libopencv_flann.a libopencv_stitching.dylib
libopencv_flann.dylib libopencv_superres.3.0.0.dylib
libopencv_hal.a libopencv_superres.3.0.dylib
libopencv_highgui.3.0.0.dylib libopencv_superres.a
libopencv_highgui.3.0.dylib libopencv_superres.dylib
libopencv_highgui.a libopencv_ts.a
libopencv_highgui.dylib libopencv_video.3.0.0.dylib
libopencv_imgcodecs.3.0.0.dylib libopencv_video.3.0.dylib
libopencv_imgcodecs.3.0.dylib libopencv_video.a
libopencv_imgcodecs.a libopencv_video.dylib
libopencv_imgcodecs.dylib libopencv_videoio.3.0.0.dylib
libopencv_imgproc.3.0.0.dylib libopencv_videoio.3.0.dylib
libopencv_imgproc.3.0.dylib libopencv_videoio.a
libopencv_imgproc.a libopencv_videoio.dylib
libopencv_imgproc.dylib libopencv_videostab.3.0.0.dylib
libopencv_ml.3.0.0.dylib libopencv_videostab.3.0.dylib
libopencv_ml.3.0.dylib libopencv_videostab.a
libopencv_ml.a libopencv_videostab.dylib
libopencv_ml.dylib pkgconfig
libopencv_objdetect.3.0.0.dylib python2.7
justin-macbook-pro:lib Justin$
我设置到目前为止的步骤是here
任何帮助都将不胜感激。
答案 0 :(得分:0)
根据您提供的链接中的文档,标头文件位于/usr/local/include
而不是/usr/local/lib
,这是库的位置。
检查您是否按照此步骤进行操作
双击“页眉搜索路径”选项,然后单击加号图标 键入以下/ usr / local / include
正确。