Jump to content
  • Advertisement

Archived

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

DAharon

SDL under RHL 7.2

This topic is 6004 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
The 'undefined "SDL_Init"' says you're not linking the SDL library.

Something like this:
gcc foobar.c -lSDL

Edited by - Clash Rocker on January 13, 2002 10:40:10 PM

Share this post


Link to post
Share on other sites
Yes, errors such as these almost always mean that you''re not linking to a required lib.

rm -rf /bin/laden

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
Thanks for the help.

Is this a typical scenario when it comes to most Linux libraries? Do they all have ???-config files?

Share this post


Link to post
Share on other sites
as far as I know, GTK++ and SDL are the ones that have that *-config script so far (GTK was the first one I think), but it is a good idea don''t you think? we can expect new Libraries to implement the functionality.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!