zxing-cpp
zxing-cpp copied to clipboard
Not compiling under VS 2013 IDE
Project generated by CMake: cmake -G "Visual Studio 12 2013" ..\
do not compile in VS2013 giving errors:
-
error C2039: 'max' : is not a member of 'std'
-
error C3861: 'max': identifier not found
Compilation in VS2012 IDE as well as by nmake
(for VC2012 and VC2013) runs fine. I am not sure if it is problem with my config or cmake
(tested with 3.1.x) or maybe something changed in IDE.
Can be fixed by adding #include <algorithm>
in sources.
This is a common change with vs12, include algorithm is the way to go:
http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx
--> You must #include
Thank you for clarification, I am wondering why cmake -G "Visual Studio 12 2013" ..\ && nmake
runs without problems.
I found some errors when using Visual Studio 2015, where you'd get the errors identified in this Stack Overflow page: http://stackoverflow.com/questions/31808256/multi-file-iostream-error-lnk2005-in-vs2015-with-za Following the advice on the page fixes it, setting Disable Language Extension back to No. (no /Za flag in CMakeLists.txt)