title: How to fix: 'torch.dll not found' error in Visual Studio after successful CMake build
body: <p>I am trying to set up a simple example of C++ code using the libtorch library. I built the project sucessfully as described on the Pytorch tutorial website. Now I defined the example-app build folder as starting point and try to run it in debugging mode. I get an error message that the torch.dll could not be found but it is listed in the external dependencies folder.</p>
  
  <p>I reinstalled the libtorch library. no success,
  I ran VS as administrator. no success,
  I rebuilt the project. no success,
  I set libtorch to the environment variables. no soccess</p>
  
  <pre><code>C++ Code: 
  
  #include &lt;torch/torch.h&gt;
  #include &lt;iostream&gt;
  
  int main() {
    torch::Tensor tensor = torch::rand({2, 3});
    std::cout &lt;&lt; tensor &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>CMakeLists.txt:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
  project(example-app)
  find_package(Torch REQUIRED)
  
  add_executable(example-app app.cpp)
  target_link_libraries(example-app "${TORCH_LIBRARIES}")
  set_property(TARGET example-app PROPERTY CXX_STANDARD 11)
  </code></pre>
  
  <p>My error message tells me (I translated it to english): </p>
  
  <blockquote>
    <p>The Execution of the code cannot be continued, because torch.dll could
    have not been found. Reinstalling the programm might resolve this
    problem</p>
  </blockquote>