jeudi 1 août 2019

OpenCV 4.x+ requires enabled C++11 support

I'm trying to compile Yolo/darknet with OpenCV on my macOS 10.14.3 (Mojave). Here is basically what I did:

I installed OpenCV via brew install opencv and it gave me version 4.1.0 (confirmed via opencv_version).

Per docs, ./darknet imtest data/eagle.jpg works fine so I know OpenCV installed somewhat successfully. Next, I try to make darknet again.

At first it complained about not finding opencv.pc, but I made a symlink opencv.pc to point to opencv4.pc in /usr/local/lib/pkgconfig/.

But now it complains about the following:

[hobbes3@hobbes3-4] ~/darknet $ make
g++ -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv`  -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -c ./src/image_opencv.cpp -o obj/image_opencv.o
In file included from ./src/image_opencv.cpp:5:
In file included from /usr/local/Cellar/opencv/4.1.0_2/include/opencv4/opencv2/opencv.hpp:52:
In file included from /usr/local/Cellar/opencv/4.1.0_2/include/opencv4/opencv2/core.hpp:52:
/usr/local/Cellar/opencv/4.1.0_2/include/opencv4/opencv2/core/cvdef.h:666:4: fatal error: "OpenCV 4.x+ requires enabled C++11 support"
#  error "OpenCV 4.x+ requires enabled C++11 support"
   ^
1 error generated.
make: *** [obj/image_opencv.o] Error 1

What do I need to do next?

Aucun commentaire:

Enregistrer un commentaire