Linking problems in Linux

Hi!

I am trying to compile my program (which works well with SDL under Win32) in
linux. I try to use KDevelop. And I get linking errors: it can’t find a
bunch of functions like “XF40DGAVidMod” or something like this (I can’t
remember exactly and I am not in the front of my linux box), anyway
functions that have XF40DGA in front of their name. If I remember correctly
I link the following libraries:

-lSDL -lGL -lGLU -lX11 -lXext -lXv -lpthread

What else am I missing. I looked in the make files under src/video/dga and
it almost looks like. Actually I am not usign any of those functions
directly the problems appears in some SDL modules when linking. I just use
SDL for initialising a OGL window and getting event information.

I am using SDL 1.2.0.

Any info?

thanks,

Vlad.

Hi!

I am trying to compile my program (which works well with SDL under Win32) in
linux. I try to use KDevelop. And I get linking errors: it can’t find a
bunch of functions like “XF40DGAVidMod” or something like this (I can’t
remember exactly and I am not in the front of my linux box), anyway
functions that have XF40DGA in front of their name. If I remember correctly
I link the following libraries:

-lSDL -lGL -lGLU -lX11 -lXext -lXv -lpthread

Are you statically linking? These functions are included in the SDL shared
library.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Ok, thanks. But then what parameters should I pass to the linker so I use
the shared libraries?

Vlad.> ----- Original Message -----

From: Sam Lantinga [mailto:slouken@devolution.com]
Sent: Thursday, 05 April, 2001 5:25 PM
To: sdl at lokigames.com
Subject: Re: [SDL] linking problems in Linux

Hi!

I am trying to compile my program (which works well with SDL under Win32)
in
linux. I try to use KDevelop. And I get linking errors: it can’t find a
bunch of functions like “XF40DGAVidMod” or something like this (I can’t
remember exactly and I am not in the front of my linux box), anyway
functions that have XF40DGA in front of their name. If I remember
correctly
I link the following libraries:

-lSDL -lGL -lGLU -lX11 -lXext -lXv -lpthread

Are you statically linking? These functions are included in the SDL shared
library.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Ok, thanks. But then what parameters should I pass to the linker so I use
the shared libraries?

linux. I try to use KDevelop.

I use KDevelop as well (for Tux Typing and the upcoming Nodin Grand) and, FWIW,
the SDL & KDevelop online docs aren’t quite correct.

Here is what I use… and I think this is the most SDL-standard way of doing
things (if I am wrong, someone please tell me ;-). The following deals entirely
with the “Project Options” screen.

Under “Linker Options” in the “Additional Flags” section I have the following:

$(shell sdl-config --cflags) $(shell sdl-config --libs)

Then, under “Additional Libraries” (also under “Linker Options”) I have:

-L/usr/include -lSDL_mixer -lSDL_image

Of course, here you will want to change the “-l” options if you aren’t using
SDL_mixer/image or if you are using something else. Also, you may need to
verify that “-L/usr/include” is correct for your installation.

These two things are all that I need to make my KDevelop made makefiles work
when compiling my SDL apps…

(Now the only problem I need to solve is fixing the KDevelop made configure
scripts actually check to see if SDL is installed on the machine! ;-)On Thu, 05 Apr 2001, you wrote:


Sam “Criswell” Hart <@Sam_Hart> AIM, Yahoo!:
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Advogato: < http://advogato.org/person/criswell/ >

BTW, my bad, that is supposed to be -I not -l :slight_smile:
cya

Jaren Peterson