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:
- dwnloaded source from sdl site to /tmp
- ./configure; make; make install
- forgot to log in as su so I got permission errors
- logged as su
- ./configure; make; make install
5.1 no problems or errors from above - 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
- 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 to
SDL_Init’
/tmp/cc6mwVb9.o(.text+0x23): undefined reference to `SDL_GetError’
collect2: ld returned 1 exit status
- 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–