2

我有 mac,os x 10.8.3

我曾经安装过 macports,我删除了它并尝试使用 Homebrew 安装 opencv。

我安装了蹩脚的ffmpeg。更改了 $PATH。错误仍然相同:

Nellys-MacBook-Pro:~ nellysmitt$ brew install opencv
==> Downloading http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/
Already downloaded: /Library/Caches/Homebrew/opencv-2.4.5.tar.gz
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.5 -DCMAKE_BUILD_TY
==> make
[ 38%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_tiff.cpp.o
Linking CXX shared library ../../lib/libopencv_video.dylib
[ 38%] Built target opencv_video
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

在安装 ffmpeg 之前,Brew Doctor 没问题。现在它告诉我们:

Nellys-MacBook-Pro:~ nellysmitt$ brew doctor
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libavcodec.52.108.0.dylib
    /usr/local/lib/libavcore.0.16.1.dylib
    /usr/local/lib/libavdevice.52.2.3.dylib
    /usr/local/lib/libavfilter.1.74.0.dylib
    /usr/local/lib/libavformat.52.93.0.dylib
    /usr/local/lib/libavutil.50.36.0.dylib
    /usr/local/lib/libmp3lame.0.dylib
    /usr/local/lib/libswscale.0.12.0.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libmp3lame.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/libavcodec.pc
    /usr/local/lib/pkgconfig/libavcore.pc
    /usr/local/lib/pkgconfig/libavdevice.pc
    /usr/local/lib/pkgconfig/libavfilter.pc
    /usr/local/lib/pkgconfig/libavformat.pc
    /usr/local/lib/pkgconfig/libavutil.pc
    /usr/local/lib/pkgconfig/libswscale.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
    /usr/local/lib/libavcodec.a
    /usr/local/lib/libavcore.a
    /usr/local/lib/libavdevice.a
    /usr/local/lib/libavfilter.a
    /usr/local/lib/libavformat.a
    /usr/local/lib/libavutil.a
    /usr/local/lib/libmp3lame.a
    /usr/local/lib/libswscale.a

但是过去 24 小时的错误是相同的。我很生气,很绝望。不知道如何安装这个该死的 OpenCV。

4

1 回答 1

0

这在 2013 年 10 月对我有用:

首先brew update以确保 homebrew 是最新的然后brew doctor并确保 homebrew 报告没有问题

然后,brew tap homebrew/science指向最新的 opencv

然后brew install opencv

祝你好运!

于 2013-10-23T02:19:20.887 回答