[SDL] Dynamically loading SDL dlls
Andre de Leiradella
leiradella at bigfoot.com
Tue Oct 30 17:49:27 PDT 2007
Well, according to the Windows API, DLLs are loaded from:
1. The directory from which the application loaded;
2. The current directory;
3. The Windows system directory (usually system32);
4. 16-bit system directory (system);
5. Windows directory (GetWindowsDirectory returns this folder); and
6. Directories listed in the PATH environment variable.
You can try item #6 to make Windows find the DLLs in the folder you want
by appending it to the PATH variable. You can make this from within your
application.
Cheers,
Andre
> Is there an alternative to SDL_SetLibraryPath ?
>
> I'd like to load the SDL libraries from a folder of my choice, one that
> isn't the executables folder, and isn't in the path. Is there no support for
> doing this? Some documentation implies the dll shouldn't be loaded/required
> until you call SDL_Init, but without the dll in the path, windows folder,
> app folder, etc. My dll that uses SDL fails to load, which indicates it does
> indeed need the sdl library well before SDL_Init. SDL_SetLibraryPath appears
> to be what I would use in this case but it seems to have been removed some
> time ago.
>
> Any alternatives?
>
> Jeremy
More information about the SDL
mailing list