glassechidna / zxing-cpp

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

Not compiling under VS 2013 IDE #5

Open baniuk opened 9 years ago

baniuk commented 9 years ago

Project generated by CMake: cmake -G "Visual Studio 12 2013" ..\ do not compile in VS2013 giving errors:

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.

SebGDev commented 9 years ago

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 when calling std::min() or std::max()

baniuk commented 9 years ago

Thank you for clarification, I am wondering why cmake -G "Visual Studio 12 2013" ..\ && nmake runs without problems.

krampster commented 8 years ago

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)