Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence warning C4996 about deprecated 'std::tr1' namespace - Windows only. #74

Closed
end2endzone opened this issue Oct 2, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@end2endzone
Copy link
Owner

When building on Windows using Visual Studio 2017, the following warnings is displayed whenever a file is including google's test header gtest-printers.h:

D:\dev\RapidAssist\third_parties\googletest\install\include\gtest/gtest-printers.h(605): 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:\RapidAssist\build\src\rapidassist\rapidassist.vcxproj]

There are multiple warnings which create scrolling blindness. This specific warnings should be disabled since it comes from an external library (googletest).

@end2endzone end2endzone added the enhancement New feature or request label Oct 2, 2021
@end2endzone
Copy link
Owner Author

end2endzone commented Oct 2, 2021

~~The solution is to add -DCMAKE_CXX_FLAGS=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING to all projects that uses gtest library.

[...] define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING within CMakeLists.txt.

@end2endzone end2endzone changed the title Silence warning C4996 about deprecated 'std::tr1' namespace Silence warning C4996 about deprecated 'std::tr1' namespace - Windows only. Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant