I'm adding code to the top of src/tuxpaint.c that provides a little more
information regarding errors about missing SDL headers.
It's a fairly common problem for someone to install SDL, SDL_mixer, etc.
packages, but not the corresponding development ("-dev" or "-devel" RPMs,
for example).
When they try to compile an SDL-based app. from source, and it bails with
a "SDL.h: file not found", they often end up e-mailing the author of the
SDL app. (e.g., me :^) ), and say "I installed SDL? Why doesn't it work!?"
The answer is, of course, "install the SDL*-devel packages, too! THEY
contain the headers, and you need them to compile SDL-based apps from source!"
I thought I'd nip the issue in the bud, by having the source tell them this
right when the error occurs. :^)
For example:
#include "SDL_image.h"
#ifndef _IMG_h
#error "---------------------------------------------------"
#error "If you installed SDL_image from a package, be sure"
#error "to get the development package, as well!"
#error "(e.g., 'libsdl-image1.2-devel.rpm')"
#error "---------------------------------------------------"
#endif
If "SDL_image.h" can't be found, it's almost definitely because
they installed the SDL_image library from a package (RPM or DEB),
which means they have the ".so" files to link against... but they
DIDN'T install the SDL_image-devel package, so there's no headers.
In that case, "_IMG_h" doesn't get #defined, and my #error directives
spit out the little blurb to stderr. :^)
For example:
$ make
...Compiling Tux Paint from source...
src/tuxpaint.c:141: SDL_image.h: No such file or directory
src/tuxpaint.c:143: #error "-------------------------------------------------"
src/tuxpaint.c:144: #error "If you installed SDL_image from a package, be sure"
src/tuxpaint.c:145: #error "to get the development package, as well!"
src/tuxpaint.c:146: #error "(e.g., 'libsdl-image1.2-devel.rpm')"
src/tuxpaint.c:147: #error "--------------------------------------------------"
make: *** [obj/tuxpaint.o] Error 1
Pretty cool, no?
Anyone see any problems with this method?
-bill!
(who notices a complete lack of naming standards when it comes to the
SDL add-on libraries' header-file "#define"s... ;^) )
--
[EMAIL PROTECTED] Got kids? Get Tux Paint!
http://newbreedsoftware.com/bill/ http://newbreedsoftware.com/tuxpaint/
_______________________________________________
Tuxpaint-dev mailing list
[EMAIL PROTECTED]
http://tux4kids.net/mailman/listinfo/tuxpaint-dev