Assume I use cmake to create a project like this:
${root}/lib/CMakeLists.txt
add_library(FooLib SHARED ${SOURCES})
${root}/main/CMakeLists.txt
add_executable(Main main.cpp)
target_link_libraries(Main FooLib)
Now if i run Main on linux(fedora in my case), it will auto load the FooLib.so. But on windows, Main.exe will complain about cannot find FooLib.dll. Of courese, if i copy FooLib.dll or manually specify a PATH, the Main.exe will also work fine.
My question are, is this because lib&dll workflow on windows?
And is there any way the Main.exe can remeber the path of FooLib library like on Linux?