[SDL] Cannot include SDL properly

Dinand Vanvelzen vanvelzen at skynet.be
Fri Jul 26 07:16:00 PDT 2002


Anders A wrote:

> try to run:
> 
> echo `sdl-config --libs` `sdl-config --cflags`
> 
> in bash and then copy n' paste whatever it outputs into the compiler
> options field of KDevelop.
> 
> //Anders Å
> 


Ok did that,
got this :

-L/usr/lib -Wl, -rpath,/usr/lib -lSDL -lpthread -I/usr/include/SDL 
-D_REENTRANT

assuming i have read the font correctly :) the l is confusing in the bash 
font.

i entered it excatly and the compiler gave me this :

Running configure in source directory 
configure: error: -L/usr/lib: invalid option; use --help to show usage 
*** failed *** 

looking at the pervious help i added ` ` and the result :

Running configure in source directory 
/bin/sh: -L/usr/lib: No such file or directory 
loading cache ./config.cache 
checking host system type... i386-pc-linux-gnu 
checking target system type... i386-pc-linux-gnu 
checking build system type... i386-pc-linux-gnu 
checking for a BSD compatible install... (cached) /usr/bin/install -c 
checking for -p flag to install... yes 
checking whether build environment is sane... yes 
checking whether make sets ${MAKE}... (cached) 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... (cached) 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... (cached) yes 
checking whether gcc accepts -g... (cached) yes 
checking how to run the C preprocessor... cpp 
checking for c++... (cached) c++ 
checking whether the C++ compiler (c++ -O0 -g3 -Wall ) works... yes 
checking whether the C++ compiler (c++ -O0 -g3 -Wall ) is a 
cross-compiler... no 
checking whether we are using GNU C++... (cached) yes 
checking whether c++ accepts -g... (cached) yes 
checking whether c++ supports -fno-exceptions... (cached) yes 
checking whether c++ supports -fno-check-new... (cached) yes 
checking whether c++ supports -fexceptions... (cached) yes 
checking how to run the C++ preprocessor... (cached) c++ -E 
checking whether c++ supports -frepo... (cached) yes 
checking for ld used by GCC... (cached) /usr/bin/ld 
checking if the linker (/usr/bin/ld) is GNU ld... (cached) yes 
checking for /usr/bin/ld option to reload object files... (cached) -r 
checking for BSD-compatible nm... (cached) /usr/bin/nm -B 
checking whether ln -s works... (cached) yes 
checking how to recognise dependant libraries... (cached) pass_all 
checking for ranlib... (cached) ranlib 
checking for strip... (cached) strip 
checking for Cygwin environment... (cached) no 
checking for mingw32 environment... (cached) no 
loading cache ./config.cache within ltconfig 
checking whether -lc should be explicitly linked in... (cached) yes 
checking for objdir... .libs 
checking for gcc option to produce PIC... -fPIC -DPIC 
checking if gcc PIC flag -fPIC -DPIC works... (cached) yes 
checking if gcc static flag -static works... (cached) yes 
finding the maximum length of command line arguments... (cached) 73729 
checking if gcc supports -c -o file.o... (cached) yes 
checking if gcc supports -fno-rtti -fno-exceptions ... yes 
checking whether the linker (/usr/bin/ld) supports shared libraries... yes 
checking how to hardcode library paths into programs... immediate 
checking whether stripping libraries is possible... yes 
checking dynamic linker characteristics... GNU/Linux ld.so 
checking command to parse /usr/bin/nm -B output... ok 
checking if libtool supports shared libraries... yes 
checking whether to build shared libraries... yes 
checking whether to build static libraries... no 
checking for dlfcn.h... (cached) yes 
checking whether a program can dlopen itself... (cached) yes 
checking whether a statically linked program can dlopen itself... (cached) 
no 
creating libtool 
loading cache ./config.cache 
loading cache ./config.cache within ltconfig 
checking host system type... i386-pc-linux-gnu 
checking build system type... i386-pc-linux-gnu 
ltcf-cxx: with_gcc=yes ; with_gnu_ld=yes 
checking for objdir... .libs 
checking for c++ option to produce PIC... -fPIC -DPIC 
checking if c++ PIC flag -fPIC -DPIC works... yes 
checking if c++ static flag -static works... yes 
finding the maximum length of command line arguments... (cached) 73729 
checking if c++ supports -c -o file.o... (cached) yes 
checking if c++ supports -fno-rtti -fno-exceptions ... yes 
checking whether the linker (/usr/bin/ld) supports shared libraries... yes 
checking how to hardcode library paths into programs... immediate 
checking whether stripping libraries is possible... yes 
checking dynamic linker characteristics... GNU/Linux ld.so 
checking command to parse /usr/bin/nm -B output... ok 
checking if libtool supports shared libraries... yes 
checking whether to build shared libraries... yes 
checking whether to build static libraries... no 
checking for dlfcn.h... (cached) yes 
checking whether a program can dlopen itself... (cached) yes 
checking whether a statically linked program can dlopen itself... (cached) 
no 
appending configuration tag "CXX" to libtool 
checking for object suffix... (cached) o 
checking for executable suffix... (cached) no 
checking for extra includes... no 
checking for extra libs... no 
checking if gu_client should be compiled... yes 
creating ./config.status 
fast creating ./Makefile 
fast creating gu_client/Makefile 
fast creating gu_client/docs/Makefile 
fast creating gu_client/docs/en/Makefile 
fast creating gu_client/SDL/Makefile 
fast creating gu_client/SDL/include/Makefile 
fast creating gu_client/SDL/src/Makefile 
creating config.h 
config.h is unchanged 
*** success *** 

Ok, at least it now accepts that command :)
Now press compile :

gmake all-recursive 
gmake[1]: Entering directory `/home/dinand/gu_client' 
Making all in gu_client 
gmake[2]: Entering directory `/home/dinand/gu_client/gu_client' 
Making all in docs 
gmake[3]: Entering directory `/home/dinand/gu_client/gu_client/docs' 
Making all in en 
gmake[4]: Entering directory `/home/dinand/gu_client/gu_client/docs/en' 
gmake[4]: Nothing to be done for `all'. 
gmake[4]: Leaving directory `/home/dinand/gu_client/gu_client/docs/en' 
gmake[4]: Entering directory `/home/dinand/gu_client/gu_client/docs' 
gmake[4]: Nothing to be done for `all-am'. 
gmake[4]: Leaving directory `/home/dinand/gu_client/gu_client/docs' 
gmake[3]: Leaving directory `/home/dinand/gu_client/gu_client/docs' 
Making all in SDL 
gmake[3]: Entering directory `/home/dinand/gu_client/gu_client/SDL' 
Making all in include 
gmake[4]: Entering directory `/home/dinand/gu_client/gu_client/SDL/include' 
gmake[4]: Nothing to be done for `all'. 
gmake[4]: Leaving directory `/home/dinand/gu_client/gu_client/SDL/include' 
Making all in src 
gmake[4]: Entering directory `/home/dinand/gu_client/gu_client/SDL/src' 
gmake[4]: Nothing to be done for `all'. 
gmake[4]: Leaving directory `/home/dinand/gu_client/gu_client/SDL/src' 
gmake[4]: Entering directory `/home/dinand/gu_client/gu_client/SDL' 
gmake[4]: Nothing to be done for `all-am'. 
gmake[4]: Leaving directory `/home/dinand/gu_client/gu_client/SDL' 
gmake[3]: Leaving directory `/home/dinand/gu_client/gu_client/SDL' 
gmake[3]: Entering directory `/home/dinand/gu_client/gu_client' 
c++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -O0 -g3 -Wall -fno-exceptions 
-fno-check-new -c main.cpp 
main.cpp: In function `int resizeWindow (int, int)': 
main.cpp:53: `GLfloat' undeclared (first use this function) 
main.cpp:53: (Each undeclared identifier is reported only once for each 
function it appears in.) 
main.cpp:53: parse error before `;' 
main.cpp:59: `ratio' undeclared (first use this function) 
main.cpp:59: parse error before `/' 
main.cpp:62: `GLint' undeclared (first use this function) 
main.cpp:62: parse error before `,' 
main.cpp:65: `GL_PROJECTION' undeclared (first use this function) 
main.cpp:65: `glMatrixMode' undeclared (first use this function) 
main.cpp:66: `glLoadIdentity' undeclared (first use this function) 
main.cpp:69: `gluPerspective' undeclared (first use this function) 
main.cpp:72: `GL_MODELVIEW' undeclared (first use this function) 
main.cpp: At top level: 
main.cpp:103: `GLvoid' was not declared in this scope 
main.cpp:104: syntax error before `{' 
main.cpp:110: ISO C++ forbids declaration of `glClearColor' with no 
type 
main.cpp:110: initializer list being treated as compound expression 
main.cpp:110: warning: initialization to `int' from `float' 
main.cpp:110: warning: argument to `int' from `float' 
main.cpp:113: ISO C++ forbids declaration of `glClearDepth' with no 
type 
main.cpp:113: warning: initialization to `int' from `float' 
main.cpp:113: warning: argument to `int' from `float' 
main.cpp:116: `GL_DEPTH_TEST' was not declared in this scope 
main.cpp:116: ISO C++ forbids declaration of `glEnable' with no type 
main.cpp:119: `GL_LEQUAL' was not declared in this scope 
main.cpp:119: ISO C++ forbids declaration of `glDepthFunc' with no type 
main.cpp:122: `GL_PERSPECTIVE_CORRECTION_HINT' was not declared in this 
scope 
main.cpp:122: `GL_NICEST' was not declared in this scope 
main.cpp:122: ISO C++ forbids declaration of `glHint' with no type 
main.cpp:122: initializer list being treated as compound expression 
main.cpp:124: parse error before `return' 
main.cpp:128: `GLvoid' was not declared in this scope 
main.cpp:129: syntax error before `{' 
main.cpp:132: syntax error before `=' 
main.cpp:135: `GL_COLOR_BUFFER_BIT' was not declared in this scope 
main.cpp:135: `GL_DEPTH_BUFFER_BIT' was not declared in this scope 
main.cpp:135: ISO C++ forbids declaration of `glClear' with no type 
main.cpp:137: ISO C++ forbids declaration of `glLoadIdentity' with no 
type 
main.cpp:137: `int glLoadIdentity ()' used prior to declaration 
main.cpp:140: ISO C++ forbids declaration of `SDL_GL_SwapBuffers' with 
no type 
main.cpp:140: new declaration `int SDL_GL_SwapBuffers ()' 
/usr/include/SDL/SDL_video.h:812: ambiguates old declaration `void 
SDL_GL_SwapBuffers ()' 
main.cpp:143: syntax error before `++' 
main.cpp:148: syntax error before `=' 
main.cpp:149: `Frames' was not declared in this scope 
main.cpp:149: `seconds' was not declared in this scope 
main.cpp:149: `fps' was not declared in this scope 
main.cpp:149: ISO C++ forbids declaration of `printf' with no type 
main.cpp:149: `int printf' redeclared as different kind of symbol 
/usr/include/stdio.h:278: previous declaration of `int printf (const 
char *, ...)' 
main.cpp:149: initializer list being treated as compound expression 
main.cpp:150: ISO C++ forbids declaration of `T0' with no type 
main.cpp:150: `t' was not declared in this scope 
main.cpp:151: ISO C++ forbids declaration of `Frames' with no type 
main.cpp:152: parse error before `}' 
main.cpp: In function `int main (int, char **)': 
main.cpp:220: `initGL' cannot be used as a function 
main.cpp:275: `drawGLScene' cannot be used as a function 
gmake[3]: *** [main.o] Error 1 
gmake[3]: Leaving directory `/home/dinand/gu_client/gu_client' 
gmake[2]: *** [all-recursive] Error 1 
gmake[2]: Leaving directory `/home/dinand/gu_client/gu_client' 
gmake[1]: *** [all-recursive] Error 1 
gmake[1]: Leaving directory `/home/dinand/gu_client' 
gmake: *** [all-recursive-am] Error 2 
*** failed *** 

Still the same.
Won't accept the identifyers although it does inlcude the SDL files :S
i don't get it... what's wrong ?

At least we are on the right track with that command :)





More information about the SDL mailing list