jbeder / yaml-cpp

A YAML parser and emitter in C++
MIT License
5.12k stars 1.84k forks source link

Included gtest is too old to compile with MSVC 15.7 / VS 2017.15.7 onwards #623

Open staffantj opened 6 years ago

staffantj commented 6 years ago

Attempting to compile the embedded gtest fails under MSVC 15.7 (2017.15.7.x).

[CustomBuild] d:\buildagent1\work\dd2dd3ecd59185a2\test\gtest-1.8.0\googletest\include\gtest\internal\gtest-port.h(996, 0): error C2220: warning treated as error - no 'object' file generated [D:\BuildAgent1\work\dd2dd3ecd59185a2\v140\test\googletest_project-prefix\src\googletest_project-build\googlemock\gmock.vcxproj]
[11:20:16][CustomBuild] d:\buildagent1\work\dd2dd3ecd59185a2\test\gtest-1.8.0\googletest\include\gtest\internal\gtest-port.h(996, 0): warning C4996: 'std::tr1': warning STL4002: The non-Standard std::tr1 namespace and TR1-only machinery are deprecated and will be REMOVED. You can define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING to acknowledge that you have received this warning. [D:\BuildAgent1\work\dd2dd3ecd59185a2\v140\test\googletest_project-prefix\src\googletest_project-build\googlemock\gmock.vcxproj]
[11:20:16][CustomBuild]   c:\vs15\vc\tools\msvc\14.14.26428\include\tuple(1163): note: see declaration of 'std::tr1'
[11:20:16]

This was fixed in gtest-1.8.1 over a year ago

staffantj commented 6 years ago

https://github.com/google/googletest/commit/77380cddf77133b98a16b5427ac732648233de29

sigmasoldi3r commented 5 years ago

Any directions to fix this?

I'm using also MSVC 2017 and I've got 24 errors (C1083) related to googletest.

peterchen-cp commented 5 years ago

I got the current head (b87c76a2ef4f974e2739a2d410ee5e36122cfc00) to build with the following changes:

While figuring out these changes, I had to run "CMake/Cache/Clear Cache Folder" and "CMake/Cache/Generate" from the menu a few times.

This is my first encounter with both CMake and MSVC's CMake "support", so I'm just fiddling around. Good luck.

julianxhokaxhiu commented 4 years ago

Another way is to just skip tests to be built by defining the CMake flag -DYAML_CPP_BUILD_TESTS=0