Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started by: Krice on July 02, 2023, 02:52:20 pm
-
If you want to ship the program with .dlls and put them into a directory in the root, how do you tell this to the linker, or is it even possible? Usually you put dlls in the same directory with .exe, but this can be messy. Trust me, I have tried to google the answer to this literally for hours. There is -rpath linker option, but I can't figure out how it works. If you put that into extra linker options in C::B the linker doesn't know that command.
-
Dll search path is an OS setting, the paths listed in the environment variable PATH are scanned.
-
So it's only the directory where the .exe is or OS locations if they are set in path. Would have imagined you could at least set a relative path from the .exe location.
-
This page (https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order) from M$ explains the DLL search algorithm in detail.