CMake: Own Shared libray in Windows: error while loading shared libraries

Linux has RPATH, so the shared library is found using that mechanism. There is no equivalent under Windows, so you must make sure the exe has access to the DLL when starting:

  • either place the DLL into the same directory as the exe,
  • or modify PATH when launching exe so that the directory with the DLL is in the PATH

This is not directly related to CMake, this applies to DLLs on Windows in general.