Mac下使用c++玩opencv

利用pkg-config 获取相应的库, 安装命令:
brew install pkg-config
重新安装opencv
brew reinstall opencv
编译程序
>g++ $(pkg-config --cflags --libs opencv) /Users/wgg/Downloads/TestOpenCV.cpp -o testOpencv
>testOpencv 
可以查看具体引用库
pkg-config --cflags --libs opencv

-I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core -lopencv_hal