title: How to link shared library *dll with CMake in Windows
body: <p>I have 2 files: <code>library.dll and library.h</code> with some code that I need in my own project. I'm working on Windows with Clion where I should config this with CMake. </p>
  
  <p>I tried this way: </p>
  
  <pre><code>cmake_minimum_required(VERSION 3.6)
  project(test2)
  
  set(CMAKE_CXX_STANDARD 11)
  link_directories(C:\\Users\\Johny\\CLionProjects\\test2)
  
  set(SOURCE_FILES main.cpp)
  add_executable(test2 ${SOURCE_FILES})
  
  target_link_libraries(test2 library.dll)
  </code></pre>
  
  <p>It compiled but didnt work. Returns <code>code -1073741515</code></p>
  
  <p>How can I handle with it? </p>