In Windows 10, how to install/include LibTorch in Visual Studio Professional 2015?

Till now, I just downloaded the LibTorch from here

I tried to include it to my Visual Studio application project, but I still get errors with “file not found”.

Also, I need to have installed PyTorch 1.0 in Windows ? I downloaded the from Kaggle Kernels.

I need a complete tutorial with how I install/include LibTorch in Visual Studio.


It will be easier if you use CMake. If you stick to building the project using VS, then instead of dragging the directory of libtorch to your project, you should add the include directory(should be in Project settings/C++) and the libraries (should be in Project settings/Linker) in the project settings.

Could you please tell some details? Which directory should be added to settings/C++? And, which libraries should be added to settings/Linker?


Could you please help me resolve issues I’m facing while trying to compile a simple cpp+libtorch code in VS 2017 on Windows:

Thanks a lot! :slight_smile:

I’ve written a tutorial on how to setup visual studio 2019 project using libtorch 1.6

The concept should be similar for other versions also.