Open stephanschulz opened 5 years ago
Hi Stephan,
I think for OpenCV 4.x the -I
path is different, it needs to be
-I/usr/local/Cellar/opencv/4.1.0_1/include/opencv4
So something like:
c++ main.cpp -std=c++11 -lopencv_highgui -lopencv_imgproc -lopencv_dnn -lopencv_core -lopencv_videoio -I/usr/local/Cellar/opencv/4.1.0_1/include/opencv4
I mentioned the correct path for 4.x in "with OF" section but haven't updated the "no OF" section.
If the new path works for you, I'll update the README.
Thanks
Hey Lingdong. Thanks that solved this specific problem. For both the terminal noof example and the Xcode version. (did not test the OF terminal option)
But in Xcode it now complains about
/Applications/of_v0.10.1_osx_release/apps/myApps/mySketch/src/ofApp.h:32:24: Use of undeclared identifier 'CV_RGB2BGR'
Hi Stephan,
It think OpenCV 4 changed their constant names.
Try cv::COLOR_RGB2BGR
Sorry the easter bunny delayed my reply.
This error got resolved. But now new ones appeared.
Here is my project:
Hi Stephan,
I believe you need to add project PROJECT_CFLAGS
to config.make
, with the same content as PROJECT_LDFLAGS
, like this:
PROJECT_CFLAGS += -lopencv_videostab -lopencv_photo -lopencv_objdetect -lopencv_video -lopencv_ml -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_flann -lopencv_imgproc -lopencv_dnn -lopencv_imgcodecs -lopencv_core
PROJECT_CFLAGS += -I/usr/local/Cellar/opencv/4.1.0_1/include/opencv4
See the 5th bullet point from the "OF+makefile" section in the README for details.
Thanks Lingdong for your help. It now works.
One thing I learned is that I can't just double click in to "other linker flags" and add the info, because it deleted references to
$(OF_CORE_LIBS)
$(OF_CORE_FRAMEWORKS)
$(LIB_OF)
and other addons
I tried to follow your instructions. I am on macOS 10.14.2, OF 0.10.1, Xcode 10.1
When compiling in the terminal and Xcode I get an error related to not finding opencv2/opencv.hpp
I wonder if brew did not create the correct symbolic links?
My opencv version is 4.1.0_1 The question also is if I always need to refer to it with _1 or leave that out?
Thanks, Stephan.