ANNOUNCE: <whatever>Kobo<whatever> v0.2 released

Right, but now I have a question related to Win32 and zlib:

The graphics engine always checks if IMG_Load() succeeds, and the game
exits gracefully if a file cannot be found. (Try removing one of the
images.)

Now, it turned out that Dominique didn’t have zlib. What I don’t
understand is how it was still possible to start the game - and get a
segfault. (If I hide zlib.dll from my system, I get a dialog saying
something like “Could not find ZLIB.DLL”, and the game won’t be executed,
and thus cannot segfault.)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -'On Wednesday 12 September 2001 23:29, Sam Lantinga wrote:

Please follow up discusssion and bug reports for specific games to the
author directly. Mailing this information to the SDL list is offtopic.

Now, it turned out that Dominique didn’t have zlib. What I don’t
understand is how it was still possible to start the game - and get a
segfault.

This is -pure- speculation, but it is possible to link a Win32 program
with the “DELAYLOAD” option under Win32 that defers loading of a DLL
until that DLL is referenced. (Thus, if you never use the DLL, it never
gets loaded, and speeding up initial load times.)

Quoting from the Microsoft site:
“But there are a couple of issues that you should take into
consideration. Normally, when the OS loader loads your executable, it
tries to load the required DLLs. If a DLL can’t be loaded, the loader
pops up a message box. But for delay-load DLLs, the existence of the DLL
is not checked at initialization time. If the DLL can’t be found when a
delay-loaded function is called, the __delayLoadHelper function raises a
software exception. You can trap this exception using a structured
exception handling (SEH) frame and keep your application running; if you
don’t trap the exception, your process will be terminated.”

See:
http://www.microsoft.com/msj/defaultframe.asp?page=/msj/1298/win32/win32
1298.htm for more details.

Personally I would like to see the DELAYLOAD option in compiled SDL DLLs
for Win32 targets, as otherwise you have to distribute a full set of
DLLs to get SDL_Image (for example) to work properly, even when you
don’t actually need them directly. But the above issue is obviously a
potential pitfall.–
Ben Sizer

Now, it turned out that Dominique didn’t have zlib. What I don’t
understand is how it was still possible to start the game - and get a
segfault.

This is -pure- speculation, but it is possible to link a Win32 program
with the “DELAYLOAD” option under Win32 that defers loading of a DLL
until that DLL is referenced. (Thus, if you never use the DLL, it never
gets loaded, and speeding up initial load times.)

Quoting from the Microsoft site:
“But there are a couple of issues that you should take into
consideration. Normally, when the OS loader loads your executable, it
tries to load the required DLLs. If a DLL can’t be loaded, the loader
pops up a message box. But for delay-load DLLs, the existence of the
DLL is not checked at initialization time. If the DLL can’t be found
when a delay-loaded function is called, the __delayLoadHelper function
raises a software exception. You can trap this exception using a
structured exception handling (SEH) frame and keep your application
running; if you don’t trap the exception, your process will be
terminated.”

Well, if that exception comes out as a segfault and invokes the SDL
parachute, that’s probably what happened.

Personally I would like to see the DELAYLOAD option in compiled SDL
DLLs for Win32 targets, as otherwise you have to distribute a full set
of DLLs to get SDL_Image (for example) to work properly, even when you
don’t actually need them directly. But the above issue is obviously a
potential pitfall.

Would be nice, but it would require this exception to be handled, or SDL
programs would start to behave like SKobo did for Dominique - no useful
information in stderr if a DLL is missing. I’d rather throw the extra
libs in than get these incomprehensible “bug” reports.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -'On Thursday 13 September 2001 23:24, Kylotan wrote: