周末跑个以前的项目,原本好好的makefile报错,
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
一顿查资料,最后brew doctor提示:
You have a non-Homebrew 'pkg-config' in your PATH:
/opt/local/bin/pkg-config
注意/opt/local/bin/, 这是mac-port的目录,上次忘了为什么装了个mac-port,导致pkg-config冲突
解决就很简单了;
echo $PATH 看下路径;
vi ~/.bash_profile 查下确保/usr/local/bin/ 目录在/opt/local/bin之前即可。