Linking SDL on XP

Hello,

I have tried to dynamically link SDL on Windows XP, by creating a dll
this way :

gcc -Wall -mno-cygwin -I"c:\SDL-1.2.7\include\SDL" -L"c:\SDL-1.2.7\lib"
-shared pad.c -lSDL -wl,-add-stdcall-alias -o pad.dll

I would like to put the dlls (SDL.dll and the created one pad.dll) in
the working directory for simpler installation ; but if SDL.dll is not
in C:\WINDOWS\SYSTEM32, it is not found at runtime.

How can I specify SDL.dll path ?

Thank you, Guillaume

Hello,

I have tried to dynamically link SDL on Windows XP, by creating a dll
this way :

gcc -Wall -mno-cygwin -I"c:\SDL-1.2.7\include\SDL" -L"c:\SDL-1.2.7\lib"
-shared pad.c -lSDL -wl,-add-stdcall-alias -o pad.dll

You should link with SDL.dll.a, which is included in the mingw development
library. When you link to it, your app will link and then depend on SDL.dll

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sam Lantinga <slouken twomix.devolution.com> writes:

Hello,

I have tried to dynamically link SDL on Windows XP, by creating a dll
this way :

gcc -Wall -mno-cygwin -I"c:\SDL-1.2.7\include\SDL" -L"c:\SDL-1.2.7\lib"
-shared pad.c -lSDL -wl,-add-stdcall-alias -o pad.dll

You should link with SDL.dll.a, which is included in the mingw development
library. When you link to it, your app will link and then depend on SDL.dll

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sam,

In fact my problem is not linking, but accessing SDL.dll at runtime in another
directory than C:\WINDOWS\SYSTEM32

I would like to put SDL.dll in a subdirectory of my application, is it possible ?

Guillaume

Sam Lantinga <slouken twomix.devolution.com> writes:

Hello,

I have tried to dynamically link SDL on Windows XP, by
creating a dll

this way :

gcc -Wall -mno-cygwin -I"c:\SDL-1.2.7\include\SDL"
-L"c:\SDL-1.2.7\lib"

-shared pad.c -lSDL -wl,-add-stdcall-alias -o pad.dll

You should link with SDL.dll.a, which is included in the
mingw development
library. When you link to it, your app will link and then
depend on SDL.dll

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sam,

In fact my problem is not linking, but accessing SDL.dll at
runtime in another
directory than C:\WINDOWS\SYSTEM32

I would like to put SDL.dll in a subdirectory of my
application, is it possible ?

Guillaume

AFAIK, when attempting to load a DLL, windows will search the current
directory and then the directories specified in the PATH environment
variable. if the DLL is not the same directory as your executable,
you’ll need to have the the directory on your PATH.

does anyone know if SDL has an environment that can be used to set the
DLL name? it is does, perhaps one could set this to '\dlls\SDL.dll’
and fool windows into loading ‘.\dlls\SDL.dll’ when it tries to find
the DLL in the current directory … ?

.marc

Guillaume Denis <denis cri.ensmp.fr> writes:

Hello,

I have tried to dynamically link SDL on Windows XP, by creating a dll
this way :

gcc -Wall -mno-cygwin -I"c:\SDL-1.2.7\include\SDL" -L"c:\SDL-1.2.7\lib"
-shared pad.c -lSDL -wl,-add-stdcall-alias -o pad.dll

I would like to put the dlls (SDL.dll and the created one pad.dll) in
the working directory for simpler installation ; but if SDL.dll is not
in C:\WINDOWS\SYSTEM32, it is not found at runtime.

How can I specify SDL.dll path ?

Thank you, Guillaume

I am updating the post even if the solution I have found might concern
few people here (Java developers).
I am using SDL.dll from Java through the JNI this way :

System.loadLibrary(“bin/SDL”);
System.loadLibrary(“bin/pad”);

I make no call to SDL from Java (my Java app calls pad.dll which calls SDL.dll)
but this way I can put SDL.dll in a subdirectory of the working directory.

Guillaume