ssimulacra
ssimulacra copied to clipboard
Can't build after opencv upgrade
OS X / 10.14.2
$ make
g++ -std=c++11 -O2 -fstrict-aliasing -ffast-math `pkg-config --cflags opencv` ssimulacra.cpp `pkg-config --libs-only-L opencv` -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -o ssimulacra
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
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
ssimulacra.cpp:81:10: fatal error: 'cv.hpp' file not found
#include <cv.hpp>
^~~~~~~~
1 error generated.
make: *** [ssimulacra] Error 1
I’m guessing this is related to the fact that Homebrew recently upgraded my OpenCV to version 4.0.1. I took a stab at fixing it by finding something that looked like opencv.pc
and symlinking it to that path:
$ ln -s /usr/local/Cellar/opencv/4.0.1/lib/pkgconfig/opencv4.pc /usr/local/lib/pkgconfig/opencv.pc
That got rid of the first error, but did not fix the second (fatal error: 'cv.hpp' file not found
).
Any advice? Should I try to install an earlier version of OpenCV?
I'm also running into this now on macOS 10.15.1, @eeeps. Received same error messages after removing OpenCV 4 and doing brew install opencv@3
. brew gave this advice:
For compilers to find opencv@3 you may need to set:
export LDFLAGS="-L/usr/local/opt/opencv@3/lib"
export CPPFLAGS="-I/usr/local/opt/opencv@3/include"
For pkg-config to find opencv@3 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/opencv@3/lib/pkgconfig"
Setting these vars worked and ssimulacra built fine.
See #6 :)