environment:
Windows 10
CUDA 10.1
CuDNN 7.6.5
libtorch from pytorch website, release mode (latest stable one)
I am able to use libtorch in a separate Visual Studio 2017 project and do the inference.
However, I need to link libtorch to another project which is using C++17 and I get deprecation errors like this:
Error C4996 'std::result_of_t': warning STL4014: std::result_of and std::result_of_t are deprecated in C++17. They are superseded by std::invoke_result and std::invoke_result_t. You can define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. WeldVision address\externals\libtorch\include\c10\util\c++17.h 34
In my own code, I disable this warning at the beginning of the header file that includes and uses the libtorch library:
Try adding -D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING=1 to your build command. In Visual Studio, this is probably somewhere in the project settings, can you define a build macro _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING=1 ?