Libtorch isn't in the {PATH} VS22 Template Problem

_Deniz: <p>Hey. I am trying to create a pytorch tutorial project with C++. I have downloaded the latest versions  of “libtorch-win-shared-with-deps-2.0.1+cpu” and “libtorch-win-shared-with-deps-debug-2.0.1+cpu” for  both debug and release. And extracted them. And downloaded the pre-configured LibTorch project for VS22.<br>
Everything seems fine until I encountered the problem when try to select folder for both debug and release files. Can anyone help me?<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/e/4e0dccfbbb81c5210477fef4064e5017b0cd3448.png" data-download-href="https://discuss.pytorch.org/uploads/default/4e0dccfbbb81c5210477fef4064e5017b0cd3448" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/4/e/4e0dccfbbb81c5210477fef4064e5017b0cd3448_2_690x467.png" alt="image" data-base62-sha1="b8uOfV08QuXpbDjgtOeEVtziIuk" width="690" height="467" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/4/e/4e0dccfbbb81c5210477fef4064e5017b0cd3448_2_690x467.png, https://discuss.pytorch.org/uploads/default/original/3X/4/e/4e0dccfbbb81c5210477fef4064e5017b0cd3448.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/4/e/4e0dccfbbb81c5210477fef4064e5017b0cd3448.png 2x" data-dominant-color="8A8C90"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1021×692 29.3 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>– I have tried to select multiple path inside libtorch file such as lib, bin and include. But it does not work.</p>

Matej_Kompanek: <p>Message comes from here: <a href="https://github.com/mszhanyi/VSIXTorch/blob/5c774fac7d0683273473308ea256fe5c2359c706/VSIXTorchShared/ConfigForm.cs#L313" rel="noopener nofollow ugc">Github code link</a><br>
It expects your selected folder containts folder named ‘libtorch’.</p>

_Deniz: <p>Thanks for the reply. After inspecting the code, I’ve successfully managed to adjust the folder structure to match the code format. Now i can not include any headers. I tried to configure additional include libraries setting in properties menu of the project but it did not help. The template is pre-configured and i don’t want to change the settings too much. What else can i do?<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/d/0/d008ea474e86398a7fa3971fa39fb0137d39cc37.png" data-download-href="https://discuss.pytorch.org/uploads/default/d008ea474e86398a7fa3971fa39fb0137d39cc37" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/d/0/d008ea474e86398a7fa3971fa39fb0137d39cc37_2_690x420.png" alt="image" data-base62-sha1="tGmpHf5oRMvRuZz3OOYdoKht0dF" width="690" height="420" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/d/0/d008ea474e86398a7fa3971fa39fb0137d39cc37_2_690x420.png, https://discuss.pytorch.org/uploads/default/optimized/3X/d/0/d008ea474e86398a7fa3971fa39fb0137d39cc37_2_1035x630.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/d/0/d008ea474e86398a7fa3971fa39fb0137d39cc37_2_1380x840.png 2x" data-dominant-color="2C3038"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1466×894 66.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

tambourineMan: <p>I had the same problem and solved it.</p>
<p>In your list of Errors, if the last one is about not having a specific Windows SDK version. You can either get that SDK or retarget SDK.</p>
<p>I retargeted the SDK: Go to Solution’s properties-&gt;Configuration Properties-&gt;General-&gt;Windows SDK Version. There is a list of versions you can select. I selected the “10.0(latest installed version)”.</p>
<p>After I retargeted the Windows SDK all the errors disappeared and I am able to run the cpp script and it shows my CUDA and GPU was detected and integrated with LibTorch. Hope this helps.</p>
<p>Best,<br>
H</p>