Compilation Problems

I am currently trying to compile a small initialize-sdl.c
program on RedHat 7.2 and I continue to get numerous
errors…

I have installed the libSDL development libraries via rpm,
and I can locate them within the /usr/lib directory…

The command I am using to compile the program is:
gcc initialize-sdl.c -o initialize-sdl sdl-config --cflags --libs

I have also tried to type in the output of the sdl-config
commands instead of back-quoting the command to no
avail…The errors are an extremely long list of undefined
references…

Perhaps, I have installed the libraries incorrectly…

Any help would be greatly appreciated…

Thanks
Joe Pugh

The command I am using to compile the program is:
gcc initialize-sdl.c -o initialize-sdl sdl-config --cflags --libs

I have also tried to type in the output of the sdl-config
commands instead of back-quoting the command to no
avail…The errors are an extremely long list of undefined
references…

You also need to add sdl-config --libs to your command line.–
Weinberg’s First Law: Progress is only made on alternate Fridays.

whoops, I didn’t read that properly… that --libs snuck on to the next
line =)

What are the undefined references to? you’re gunna need to add
-l flags for whatever it’s missing.

Julian.On Wed, 26 Feb 2003 9:05 pm NZDT, Julian Peterson wrote:

The command I am using to compile the program is:
gcc initialize-sdl.c -o initialize-sdl sdl-config --cflags --libs

I have also tried to type in the output of the sdl-config
commands instead of back-quoting the command to no
avail…The errors are an extremely long list of undefined
references…

You also need to add sdl-config --libs to your command line.


Cabbage, n.:
A familiar kitchen-garden vegetable about as large and wise
as a man’s head.
– Ambrose Bierce, “The Devil’s Dictionary”

Julian Peterson wrote:> On Wed, 26 Feb 2003 9:05 pm NZDT, Julian Peterson wrote:

The command I am using to compile the program is:
gcc initialize-sdl.c -o initialize-sdl sdl-config --cflags --libs

I have also tried to type in the output of the sdl-config
commands instead of back-quoting the command to no
avail…The errors are an extremely long list of undefined
references…

You also need to add sdl-config --libs to your command line.

whoops, I didn’t read that properly… that --libs snuck on to the next
line =)

What are the undefined references to? you’re gunna need to add
-l flags for whatever it’s missing.

Julian.

The undefined references start like this:

/usr/lib/libSDL.a(SDL_x11video.lo): In function ‘X11_Available’:
SDL_x11video.lo(.text+0x1d): undefined reference to XOpenDisplay' SDL_xllvideo.lo(.text+0x2f): undefined reference toXCloseDisplay’
/usr/lib/libSDL.a(SDL_x11video.lo): In function ‘create_aux_windows’:
SDL_x11video.lo(.text+0x453): undefined reference to ‘XDestroyWindow’

There are a lot of errors like this, from what I can tell…

Looks like a problem with my libSDL install…

Joe

H there

The undefined references start like this:

/usr/lib/libSDL.a(SDL_x11video.lo): In function ‘X11_Available’:
SDL_x11video.lo(.text+0x1d): undefined reference to XOpenDisplay' SDL_xllvideo.lo(.text+0x2f): undefined reference toXCloseDisplay’
/usr/lib/libSDL.a(SDL_x11video.lo): In function
’create_aux_windows’: SDL_x11video.lo(.text+0x453): undefined
reference to ‘XDestroyWindow’…

Hmm have you tryed to compile other X11 apps. Because the message
above tells you that tbe SDL lib can’t be linked to X11. You maybe
have to install some other X11-dev packages.

The message “undefined reference to ‘XYZ’” means that the compiler
can’t find in any libs there this XYZ is. (hmm well i don’t know how
to translate this right)

Oky thats all now… byebye
Steffen