Trying to build on OS X Mojave after brew install opencv fails:
$ mkdir build
$ cd build
$ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
$ make
[ 1%] Building CXX object CMakeFiles/libzxing.dir/opencv/src/zxing/MatSource.cpp.o
In file included from /Users/kousu/src/zxing-cpp/opencv/src/zxing/MatSource.cpp:17:
In file included from /Users/kousu/src/zxing-cpp/opencv/src/zxing/MatSource.h:21:
In file included from /usr/local/include/opencv4/opencv2/core/core.hpp:48:
In file included from /usr/local/include/opencv4/opencv2/core.hpp:52:
/usr/local/include/opencv4/opencv2/core/cvdef.h:656:4: error: "OpenCV 4.x+ requires enabled C++11 support"
# error "OpenCV 4.x+ requires enabled C++11 support"
...
/usr/local/include/opencv4/opencv2/core/mat.hpp:1011:52: error: no template named 'initializer_list' in namespace 'std'
template<typename _Tp> explicit Mat(const std::initializer_list<int> sizes, const std::initializer_list<_Tp> list);
...
I think these are because Darwin's clang compiler isn't defaulting to C++11 fully.
Trying to build on OS X Mojave after
brew install opencv
fails:I think these are because Darwin's clang compiler isn't defaulting to C++11 fully.