Visual studio don't see the libtorch

username: andrewshvecov7
cooked: <p>I followed this <a href="https://pytorch.org/cppdocs/installing.html" class="inline-onebox" rel="noopener nofollow ugc">Installing C++ Distributions of PyTorch — PyTorch main documentation</a><br>
I have successfully build example-app.exe.</p>
<pre><code class="lang-auto">C:\Users\Acer\C++ projects\fraimworks\example-app&gt;mkdir build

C:\Users\Acer\C++ projects\fraimworks\example-app&gt;cd build

C:\Users\Acer\C++ projects\fraimworks\example-app\build&gt;cmake -DCMAKE_PREFIX_PATH=C:\Packages\libtorch ..
-- Building for: Visual Studio 17 2022
-- The C compiler identification is MSVC 19.38.33134.0
-- The CXX compiler identification is MSVC 19.38.33134.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1 (found version "12.1")
-- The CUDA compiler identification is NVIDIA 12.1.66
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/include (found version "12.1.66")
-- Caffe2: CUDA detected: 12.1
-- Caffe2: CUDA nvcc is: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe
-- Caffe2: CUDA toolkit directory: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1
-- Caffe2: Header version is: 12.1
-- C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/lib/x64/nvrtc.lib shorthash is bac8224f
-- USE_CUDNN is set to 0. Compiling without cuDNN support
-- USE_CUSPARSELT is set to 0. Compiling without cuSPARSELt support
-- Autodetected CUDA architecture(s):  7.5
-- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75
-- Found Torch: C:/Packages/libtorch/lib/torch.lib
-- Configuring done (23.2s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/Acer/C++ projects/fraimworks/example-app/build

C:\Users\Acer\C++ projects\fraimworks\example-app\build&gt;cmake --build . --config Release
Версия MSBuild 17.8.5+b5265ef37 для .NET Framework

  1&gt;Checking Build System
  Building Custom Rule C:/Users/Acer/C++ projects/fraimworks/example-app/CMakeLists.txt
  example-app.cpp
     Creating library C:/Users/Acer/C++ projects/fraimworks/example-app/build/Release/example-app.lib and object C:/Use
  rs/Acer/C++ projects/fraimworks/example-app/build/Release/example-app.exp
  example-app.vcxproj -&gt; C:\Users\Acer\C++ projects\fraimworks\example-app\build\Release\example-app.exe
  Building Custom Rule C:/Users/Acer/C++ projects/fraimworks/example-app/CMakeLists.txt
</code></pre>
<p>and it takes a long time to start every time .</p>
<p>but in other project i can’t include  but it prints :<code>Severity Code Description Project File Line Suppression State Details Error C1083 Cannot open include file: 'torch': No such file or directory Project1 C:\Users\Acer\C++ projects\fraimworks\Project1\main.cpp 1</code></p>
<p>What can I do with it?</p>