News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

How to set the dll search path for executable?

Started by Krice, July 02, 2023, 02:52:20 PM

Previous topic - Next topic

Krice

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.

Miguel Gimenez

Dll search path is an OS setting, the paths listed in the environment variable PATH are scanned.

Krice

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.

Miguel Gimenez

This page from M$ explains the DLL search algorithm in detail.