[SDL] Can't build SDL applications
Amauri Gutierrez Martins Júnior
amaurijr at ieg.com.br
Mon Jun 24 00:55:51 PDT 2024
Greetings,
I'm a Linux Slackware 7.0 user and I'm having problems when trying to
build applications that use SDL.
I had no problems when compiling/installing SDL itself, but I can't even
build the test applications that come with the package.
When I type 'configure' in the 'test' directory I receive the following
output:
<mailto:amaurijr at ieg.com.br>
<mailto:amaurijr at ieg.com.br>
<mailto:amaurijr at ieg.com.br>
-----
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for working const... yes
checking how to run the C preprocessor... gcc -E
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for dnet_ntoa in -ldnet... no
checking for dnet_ntoa in -ldnet_stub... no
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for sdl-config... /usr/local/bin/sdl-config
checking for SDL - version >= 1.2.0... no
*** Could not run SDL test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means SDL was incorrectly installed
*** or that you have moved SDL since it was installed. In the latter case, you
*** may want to edit the sdl-config script: /usr/local/bin/sdl-config
-----
I made sure everything is correct with ld.so.conf (i.e. it contains
/usr/local/lib) and that /usr/local/bin is in the execution path.
There are no other versions of SDL installed in my system and I removed
all files named 'config.cache' I found.
As you can see, I did everything I read in the FAQ but still it does not
work.
'which sdl-config' gives me the following:
/usr/local/bin/sdl-config
'sdl-config --version':
1.2.1
'locate libSDL'
/usr/local/lib/libSDL-1.2.so.0
/usr/local/lib/libSDL-1.2.so.0.0.1
/usr/local/lib/libSDL.a
/usr/local/lib/libSDL.la
/usr/local/lib/libSDL.so
/usr/local/lib/libSDLmain.a
And here is my config.log file:
-----
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:562: checking host system type
configure:583: checking target system type
configure:613: checking for a BSD compatible install
configure:666: checking whether build environment is sane
configure:723: checking whether make sets ${MAKE}
configure:769: checking for working aclocal
configure:782: checking for working autoconf
configure:795: checking for working automake
configure:808: checking for working autoheader
configure:821: checking for working makeinfo
configure:839: checking for gcc
configure:952: checking whether the C compiler (gcc ) works
configure:968: gcc -o conftest conftest.c 1>&5
configure:994: checking whether the C compiler (gcc ) is a cross-compiler
configure:999: checking whether we are using GNU C
configure:1008: gcc -E conftest.c
configure:1027: checking whether gcc accepts -g
configure:1061: checking for working const
configure:1115: gcc -c -g -O2 conftest.c 1>&5
configure:1158: checking how to run the C preprocessor
configure:1179: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1242: checking for X
configure:1556: checking for dnet_ntoa in -ldnet
configure:1575: gcc -o conftest -g -O2 conftest.c -ldnet 1>&5
/usr/i386-slackware-linux/bin/ld: cannot open -ldnet: No such file or directory
collect2: ld returned 1 exit status
configure: failed program was:
#line 1564 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dnet_ntoa();
int main() {
dnet_ntoa()
; return 0; }
configure:1597: checking for dnet_ntoa in -ldnet_stub
configure:1616: gcc -o conftest -g -O2 conftest.c -ldnet_stub 1>&5
/usr/i386-slackware-linux/bin/ld: cannot open -ldnet_stub: No such file or directory
collect2: ld returned 1 exit status
configure: failed program was:
#line 1605 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dnet_ntoa();
int main() {
dnet_ntoa()
; return 0; }
configure:1645: checking for gethostbyname
configure:1673: gcc -o conftest -g -O2 conftest.c 1>&5
configure:1743: checking for connect
configure:1771: gcc -o conftest -g -O2 conftest.c 1>&5
configure:1835: checking for remove
configure:1863: gcc -o conftest -g -O2 conftest.c 1>&5
configure:1927: checking for shmat
configure:1955: gcc -o conftest -g -O2 conftest.c 1>&5
configure:2028: checking for IceConnectionNumber in -lICE
configure:2047: gcc -o conftest -g -O2 -L/usr/X11R6/lib conftest.c -lICE 1>&5
configure:2123: checking for sdl-config
configure:2158: checking for SDL - version >= 1.2.0
configure:2243: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/local/include -I/usr/local/include/SDL -D_REENTRANT conftest.c -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread 1>&5
/usr/X11R6/lib/libX11.so.6: undefined reference to `shmctl@@GLIBC_2.0'
collect2: ld returned 1 exit status
configure: failed program was:
#line 2182 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro;
char *tmp_version;
/* This hangs on some systems (?)
system ("touch conf.sdltest");
*/
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("1.2.0");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
printf("%s, bad version string\n", "1.2.0");
exit(1);
}
if ((1 > major) ||
((1 == major) && (2 > minor)) ||
((1 == major) && (2 == minor) && (1 >= micro)))
{
return 0;
}
else
{
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", 1, 2, 1);
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
configure:2292: gcc -o conftest -g -O2 -I/usr/X11R6/include -I/usr/local/include -I/usr/local/include/SDL -D_REENTRANT conftest.c -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread 1>&5
/usr/X11R6/lib/libX11.so.6: undefined reference to `shmctl@@GLIBC_2.0'
collect2: ld returned 1 exit status
configure: failed program was:
#line 2277 "configure"
#include "confdefs.h"
#include <stdio.h>
#include "SDL.h"
int main(int argc, char *argv[])
{ return 0; }
#undef main
#define main K_and_R_C_main
int main() {
return 0;
; return 0; }
-----
Does anybody have any ideia of what is going on and how can I solve this
problem?
From now, thanks.
More information about the SDL
mailing list