Help, help ! strange behavior

i have windows 2000, mingw1.0, cygwin & SDL of course
and i have a (windows ?) problem.

i have a little test program you could download at
http://www.galador.net/sample/linkSDL.tgz

and compile with:
gcc -o a main.cpp -L. -lSDL

it run fine.
but, if you move SDL.dll elsewhere in the path, instead of letting it in
the same directory than the executable, it fail at launch time popping
error panel claiming “SDL_GetClipRect not found in SDL.dll”.

but if you remove line 80 in main.cpp (a unsefull SDL_GetClipRect call,
here just for test reason) and recompile, it work fine.

so, ok i manage to run my application, but could anybody explain me this
strange behavior ?

Lloyd Dupont writes:

i have windows 2000, mingw1.0, cygwin & SDL of course
and i have a (windows ?) problem.

i have a little test program you could download at
http://www.galador.net/sample/linkSDL.tgz

and compile with:
gcc -o a main.cpp -L. -lSDL

it run fine.
but, if you move SDL.dll elsewhere in the path, instead of letting it in
the same directory than the executable, it fail at launch time popping
error panel claiming “SDL_GetClipRect not found in SDL.dll”.

but if you remove line 80 in main.cpp (a unsefull SDL_GetClipRect call,
here just for test reason) and recompile, it work fine.

so, ok i manage to run my application, but could anybody explain me this
strange behavior ?
Guess - Leftover old SDL.dll somewhere else on your computer, the
devil ( Bill Gates ) only knows how dll’s are found on windows :-)–
Best Regards / Venlig Hilsen
Rasmus Toftdahl Olesen
halfdan at halfdan.dyndns.org
http://halfdan.dyndns.org

It sounds like it is trying to link with another SDL.dll somewhere on
your PATH. Use this tool http://www.dependencywalker.com/. It will tell
you exactly where the version is that you are linking to.

Lloyd Dupont wrote:>

i have windows 2000, mingw1.0, cygwin & SDL of course
and i have a (windows ?) problem.

i have a little test program you could download at
http://www.galador.net/sample/linkSDL.tgz

and compile with:
gcc -o a main.cpp -L. -lSDL

it run fine.
but, if you move SDL.dll elsewhere in the path, instead of letting it in
the same directory than the executable, it fail at launch time popping
error panel claiming “SDL_GetClipRect not found in SDL.dll”.

but if you remove line 80 in main.cpp (a unsefull SDL_GetClipRect call,
here just for test reason) and recompile, it work fine.

so, ok i manage to run my application, but could anybody explain me this
strange behavior ?

Guess - Leftover old SDL.dll somewhere else on your computer, the
devil ( Bill Gates ) only knows how dll’s are found on windows :slight_smile:

I’m pretty sure I have seen the search path order in MSDN, it’s
something like the application’s path, the WinSys directory, the
Windows directory and then any directories listed in the PATH
environment variable.

Hey, I wasn’t too far off:

http://www.google.com/search?q=cache:BlSnAAaTjsM:msdn.microsoft.com/li
brary/devprods%255Cvs6%255Cvisualc/vccore/_core_the_search_path_used_b
y_windows_to_locate_a_dll.htm+site:msdn.microsoft.com+DLL+search+path&
hl=en–

Olivier A. Dagenais - Software Architect and Developer

I am having a little problem with the mouse functions in SDL. I am using
the mouse to look around my app (3d landscape engine). At the moment I use
SDL_WarpMouse(width/2, height/2); when I am starting up the app. Then use
SDL_GetMouseState(&mousePos[0], &mousePos[1]);
SDL_WarpMouse(width/2, height/2);
each frame to check if the ‘player’ has moved there mouse, and if so, rotate
my camera proportionately. My problem is if I use WarpMouse, then it will
not instantly move the mouse back to the width/2, height/2, which means the
my app starts not looking straight forward, but looking somewhere else,
depending on where the mouse was before u run the program. I tried getting
the cursor using SDL_GetCursor and then changing it’s hoty, hotx, but that
didn’t work. Can anyone help me out here?

Thanks,

Tristan

I am having a little problem with the mouse functions in SDL. I am using
the mouse to look around my app (3d landscape engine). At the moment I use
SDL_WarpMouse(width/2, height/2); when I am starting up the app. Then use
SDL_GetMouseState(&mousePos[0], &mousePos[1]);
SDL_WarpMouse(width/2, height/2);
each frame to check if the ‘player’ has moved there mouse, and if so, rotate
my camera proportionately. My problem is if I use WarpMouse, then it will
not instantly move the mouse back to the width/2, height/2, which means the
my app starts not looking straight forward, but looking somewhere else,
depending on where the mouse was before u run the program. I tried getting
the cursor using SDL_GetCursor and then changing it’s hoty, hotx, but that
didn’t work. Can anyone help me out here?

What you really want to do is have SDL give you relative mouse motion.
If you hide the cursor and grab the input, on Linux and Windows SDL will
give you continuous mouse motion (not bounded by the window), so you can
respond to SDL motion events and look at xrel and yrel.

See ya!
-Sam Lantinga, Lead Programmer, Loki Software, Inc.