Search code examples
c++visual-studio-2017suppress-warnings

VS 2017 Command line error D8004


I'm out of options, I'm trying to work with GoogleTest on Visual Studio 2017 Community but it gives me a lot of

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.

I want to supress it, so I go under my Project Properties -> C/C++ -> Advanced -> Supress Specific Warnings and I try

/wd4996
/wdSTL4002,
/wd4996;
/wdC4996
/wd[4996]...

etc, I honestly tried every possible combination and it throws me

2>cl : Command line error D8004: '/wd' requires an argument

Could someone send me exactly what I need to write there to supress this?


Solution

  • According to the error message, you can add a #define equivalent to the command line:

    /D:_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
    

    That is the equivalent of inserting before the first line of the source files

    #define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING  1