Discussion:
[Cucumber] [CPP] Unable to build with latest Visual Studio
(too old to reply)
Hans Kester
2018-06-19 13:25:11 UTC
Permalink
When I follow the build instructions from
https://github.com/cucumber/cucumber-cpp/tree/master I get errors in the
step "cmake --build build". The problem seems to be that Google Test treats
errors as warnings:

d:\development\cucumber-cpp\build\gmock\src\gmock\googletest\include\gtest\internal\gtest-port.h(996):
error C2220: warning treated as error - no 'object' file generated
[D:\Development\cucumber-cpp\build\gmock\src\gmock-build\googlemock\gmock.vcxproj]
d:\development\cucumber-cpp\build\gmock\src\gmock\googletest\include\gtest\internal\gtest-port.h(996):
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:\Development\cucumber-cpp\build\gmock\src\gmock-build\googlemock\gmock.vcxproj]
c:\program files (x86)\microsoft visual
studio\2017\professional\vc\tools\msvc\14.14.26428\include\tuple(1163):
note: see declaration of 'std::tr1'

I use Visual Studio 2017 version 15.7.4.

How do I fix this?
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeff Langr
2018-07-12 22:27:39 UTC
Permalink
We were able to get past this with the following workaround edit to the
CMakeLists.txt:

elseif(MSVC)
set(CMAKE_CXX_FLAGS "-DNOMINMAX ${CMAKE_CXX_FLAGS}") # exclude M$
min/max macros
set(CMAKE_CXX_FLAGS "/wd4996 ${CMAKE_CXX_FLAGS}") # don't warn about
use of plain C functions without (non-portable) "_s" suffix
* set(CMAKE_EXE_LINKER_FLAGS "/WX:NO ${CMAKE_EXE_LINKER_FLAGS}" ) #
don't treat warnings as compile errors--gtest doesn't build*
#set(CMAKE_CXX_FLAGS_DEBUG "/analyze ${CMAKE_CXX_FLAGS_DEBUG}")
endif()

Seems like the cucumber-cpp folks would be able to come up with a better
solution, though.

Jeff / Erik
Post by Hans Kester
When I follow the build instructions from
https://github.com/cucumber/cucumber-cpp/tree/master I get errors in the
step "cmake --build build". The problem seems to be that Google Test treats
error C2220: warning treated as error - no 'object' file generated
[D:\Development\cucumber-cpp\build\gmock\src\gmock-build\googlemock\gmock.vcxproj]
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:\Development\cucumber-cpp\build\gmock\src\gmock-build\googlemock\gmock.vcxproj]
c:\program files (x86)\microsoft visual
note: see declaration of 'std::tr1'
I use Visual Studio 2017 version 15.7.4.
How do I fix this?
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...