Archived

This topic is now archived and is closed to further replies.

DAharon

SDL under RHL 7.2

Recommended Posts

Since I have given up porting my homemade graphics library to Linux, I have taken others'' suggestions to use SDL. I just installed it and it won''t let me compile the SDL_init.c example. It''s the most basic program using the SDL library. I tried fiddling with ld.so.conf and I ran ldconfig, but all I get with gcc is: undefined "SDL_Init" undefined "SDL_Quit" Blah Blah Does anyone know why I might be encountering this problem?

Share this post


Link to post
Share on other sites
How are you compiling it? Have you tried:
    gcc -o abc abc.c `sdl-config --cflags --libs`
That should do it. I don''t know about this "SDL_init.c example" (maybe I''m blind ), but does it include the SDL headers required?

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
Do it the Null and Void way, the `sdl-config --cflags --libs` part makes sure you link with the correct libraries, and use the correct include paths, if you still get the same error, run # sdl-config --cflags --libs directly from the command line, and make sure its output is right (the directory names exist and contain the needed libs and headers)

then you can edit the /usr/bin/sdl-config (or /usr/local/bin/sdl-config if you compiled from tars) to output the right paths.

hmmm . . . did you compiled from tars?, Redhat comes with a SDL-devel rpm, if you did, and the rpm was installed durring the OS setup (or later), they might be conflicting.

Share this post


Link to post
Share on other sites
To resume all the helpful replies:

1) Make sure the SDL Development package is installed. By default, Redhat7.2 installs the SDL runtime library rpm only. The SDL development libraries are located in the SDL-devel 1.2.2-3 rpm located on one of the binaries CDROM.

2) Make sure the source code includes SDL/sdl.h header

3) Compiles the program with the command:
gcc SDL_init.c -o SDL_init `sdl-config --cflags --libs`

and ... voila that''s all there is to do.

Share this post


Link to post
Share on other sites