glassechidna / zxing-cpp

ZXing C++ Library
Apache License 2.0
597 stars 435 forks source link

Darwin build fails #75

Closed kousu closed 5 years ago

kousu commented 5 years ago

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.

Benjamin-Dobell commented 5 years ago

Resolved by #76 / e0e40ddec63f38405aca5c8c1ff60b85ec8b1f10