SDL compile problems!

Hello,

After installing SDL from the source I’m not able to compile/build SDL
files.

My setup: Linux Redhat 7.0, kernel 2.2.16-22

Here are the steps I took:

  1. dwnloaded source from sdl site to /tmp
  2. ./configure; make; make install
  3. forgot to log in as su so I got permission errors
  4. logged as su
  5. ./configure; make; make install
    5.1 no problems or errors from above
  6. tried to compile the following stub function:

gcc sample.c

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>

int main()
{
SDL_Surface *screen;

return 0;

}

NO Problems, compiled fined

  1. tried the following:

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>

int main()
{
SDL_Surface *screen;

if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
    printf ("Unable to init SDL: %s\n", SDL_GetError() );
    return 1;
}
return 0;

}

And got the following errors:
/tmp/cc6mwVb9.o: In function main': /tmp/cc6mwVb9.o(.text+0xc): undefined reference toSDL_Init’
/tmp/cc6mwVb9.o(.text+0x23): undefined reference to `SDL_GetError’
collect2: ld returned 1 exit status

  1. Followed Linux FAQ on SDL site, here are the results:

Adde

/usr/local/lib
to /etc/ld.so.conf

As root, ran /sbin/ldconfig

Made sure /usr/local/bin is in my execution path:

Didn’t find any config.cache in the dir I’m building from

Here is the output from the requested debug commands from the Linux FAQ

my pwd is ~/source/C

[rbalzer at starbuck C]$ which sdl-config
/usr/local/bin/sdl-config
[rbalzer at starbuck C]$ sdl-config --version
1.2.3
[rbalzer at starbuck C]$ locate libSDL
/usr/lib/libSDL-1.1.so.0
/usr/lib/libSDL-1.1.so.0.3.1
[rbalzer at starbuck C]$ tail config.log
tail: config.log: No such file or directory
[rbalzer at starbuck C]$

I never installed SDL before so there are no other versions to remove–

===================================
http://resumes.dice.com/randybalzer

randybalzer at yahoo.com
rbalzer at utdallas.edu
JavaJedi at ev1.net

What was the command line you used to compile?On Mon, 2002-04-08 at 14:09, Randy Balzer wrote:

Hello,

After installing SDL from the source I’m not able to compile/build SDL
files.

My setup: Linux Redhat 7.0, kernel 2.2.16-22

Here are the steps I took:

  1. dwnloaded source from sdl site to /tmp
  2. ./configure; make; make install
  3. forgot to log in as su so I got permission errors
  4. logged as su
  5. ./configure; make; make install
    5.1 no problems or errors from above
  6. tried to compile the following stub function:

gcc sample.c

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>

int main()
{
SDL_Surface *screen;

return 0;

}

NO Problems, compiled fined

  1. tried the following:

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>

int main()
{
SDL_Surface *screen;

if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
    printf ("Unable to init SDL: %s\n", SDL_GetError() );
    return 1;
}
return 0;

}

And got the following errors:
/tmp/cc6mwVb9.o: In function main': /tmp/cc6mwVb9.o(.text+0xc): undefined reference toSDL_Init’
/tmp/cc6mwVb9.o(.text+0x23): undefined reference to `SDL_GetError’
collect2: ld returned 1 exit status

  1. Followed Linux FAQ on SDL site, here are the results:

Adde

/usr/local/lib
to /etc/ld.so.conf

As root, ran /sbin/ldconfig

Made sure /usr/local/bin is in my execution path:

Didn’t find any config.cache in the dir I’m building from

Here is the output from the requested debug commands from the Linux FAQ

my pwd is ~/source/C

[rbalzer at starbuck C]$ which sdl-config
/usr/local/bin/sdl-config
[rbalzer at starbuck C]$ sdl-config --version
1.2.3
[rbalzer at starbuck C]$ locate libSDL
/usr/lib/libSDL-1.1.so.0
/usr/lib/libSDL-1.1.so.0.3.1
[rbalzer at starbuck C]$ tail config.log
tail: config.log: No such file or directory
[rbalzer at starbuck C]$

I never installed SDL before so there are no other versions to remove

===================================
http://resumes.dice.com/randybalzer

randybalzer at yahoo.com
rbalzer at utdallas.edu
JavaJedi at ev1.net

End of Rant.

Jimmy
Jimmy’s World (http://www.jimmysworld.org)
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020408/48d3fb98/attachment.pgp

You didn’t linked against libSDL.so .

Try something like

gcc -o sample sample.c `sdl-config --cflags` `sdl-config --libs`

You didn't saw any errors with your first example because you
were installing to /usr/local/include or /usr/include which
may be already in your default include path and threfore
SDL/SDL.h worked. Yet without linking to libSDL actually you
can't call any function from it (makes sense?).

Next time also paste the actual compile and link line you
did.

- Markus

On Mon, Apr 08, 2002 at 01:09:44PM -0500, Randy Balzer wrote :> Hello,

After installing SDL from the source I’m not able to compile/build SDL
files.

My setup: Linux Redhat 7.0, kernel 2.2.16-22

Here are the steps I took:

  1. dwnloaded source from sdl site to /tmp
  2. ./configure; make; make install
  3. forgot to log in as su so I got permission errors
  4. logged as su
  5. ./configure; make; make install
    5.1 no problems or errors from above
  6. tried to compile the following stub function:

gcc sample.c

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>

int main()
{
SDL_Surface *screen;

return 0;
}

NO Problems, compiled fined

  1. tried the following:

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>

int main()
{
SDL_Surface *screen;

if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
printf (“Unable to init SDL: %s\n”, SDL_GetError() );
return 1;
}
return 0;
}

And got the following errors:
/tmp/cc6mwVb9.o: In function main': /tmp/cc6mwVb9.o(.text+0xc): undefined reference toSDL_Init’
/tmp/cc6mwVb9.o(.text+0x23): undefined reference to `SDL_GetError’
collect2: ld returned 1 exit status

  1. Followed Linux FAQ on SDL site, here are the results:

Adde

/usr/local/lib
to /etc/ld.so.conf

As root, ran /sbin/ldconfig

Made sure /usr/local/bin is in my execution path:

Didn’t find any config.cache in the dir I’m building from

Here is the output from the requested debug commands from the Linux FAQ

my pwd is ~/source/C

[rbalzer at starbuck C]$ which sdl-config
/usr/local/bin/sdl-config
[rbalzer at starbuck C]$ sdl-config --version
1.2.3
[rbalzer at starbuck C]$ locate libSDL
/usr/lib/libSDL-1.1.so.0
/usr/lib/libSDL-1.1.so.0.3.1
[rbalzer at starbuck C]$ tail config.log
tail: config.log: No such file or directory
[rbalzer at starbuck C]$

I never installed SDL before so there are no other versions to remove

===================================
http://resumes.dice.com/randybalzer

randybalzer at yahoo.com
rbalzer at utdallas.edu
JavaJedi at ev1.net


Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Mind if I MFH ?" “What QA did you do on it?” “the usual?” “ah… none :)”

try:

cc -o myproggie myproggie.c sdl-config --cflags sdl-config --libsOn 2002.04.08 20:09 Randy Balzer wrote:

Hello,

After installing SDL from the source I’m not able to compile/build
SDL files.

My setup: Linux Redhat 7.0, kernel 2.2.16-22

Here are the steps I took:

  1. dwnloaded source from sdl site to /tmp
  2. ./configure; make; make install
  3. forgot to log in as su so I got permission errors
  4. logged as su
  5. ./configure; make; make install
    5.1 no problems or errors from above
  6. tried to compile the following stub function:

gcc sample.c

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>

int main()
{
SDL_Surface *screen;

return 0;
}

NO Problems, compiled fined

  1. tried the following:

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>

int main()
{
SDL_Surface *screen;

if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
printf (“Unable to init SDL: %s\n”, SDL_GetError() );
return 1;
}
return 0;
}

And got the following errors:
/tmp/cc6mwVb9.o: In function main': /tmp/cc6mwVb9.o(.text+0xc): undefined reference toSDL_Init’
/tmp/cc6mwVb9.o(.text+0x23): undefined reference to `SDL_GetError’
collect2: ld returned 1 exit status

  1. Followed Linux FAQ on SDL site, here are the results:

Adde

/usr/local/lib
to /etc/ld.so.conf

As root, ran /sbin/ldconfig

Made sure /usr/local/bin is in my execution path:

Didn’t find any config.cache in the dir I’m building from

Here is the output from the requested debug commands from the Linux
FAQ

my pwd is ~/source/C

[rbalzer at starbuck C]$ which sdl-config
/usr/local/bin/sdl-config
[rbalzer at starbuck C]$ sdl-config --version
1.2.3
[rbalzer at starbuck C]$ locate libSDL
/usr/lib/libSDL-1.1.so.0
/usr/lib/libSDL-1.1.so.0.3.1
[rbalzer at starbuck C]$ tail config.log
tail: config.log: No such file or directory
[rbalzer at starbuck C]$

I never installed SDL before so there are no other versions to remove

===================================
http://resumes.dice.com/randybalzer

randybalzer at yahoo.com
rbalzer at utdallas.edu
JavaJedi at ev1.net