I am using KDevelop and SDL, and I new in C/C++ programming. I am reading
the manual in HTML format of SDL put I don’t know how I need to use #include
and SDL.h in my programs.
I was used #include “SDL.h” and #include <SDL.h", but not work. The include
files are all in /usr/local/include/SDL.
My first program;
printf(“Activando la libreria SDL.\n”);
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)==-1)
printf(“No se puede activar SDL: %s.\n”, SDL_GetError());
printf("\nDesactivando SDL… ");
Debian Woody 3, KDevelop 2.1.5, KDE 3.1.4, Gcc 3.2.3_________________________________________________________________
Charla con tus amigos en l?nea mediante MSN Messenger:
Jfs Dlt wrote:
If you do #include <SDL.h>, then you need to tell your compiler where
the headers are located, which is usually done with the “sdl-config
–cflags” scripts, add this to the -I options of gcc (don’t know where
exactly in kdevelop this can be configured).
This has the advantage, if someone has the SDL headers in some obscure
directory which is not in the standard compiler search path, sdl-config
will point the compiler to the right directory.
A second way is to do #include <SDL/SDL.h> and don’t use sdl-config
script, then the SDL headers must be in some directory gcc looks into,
Simple example makefile for "#include “SDL.h”:
gcc -o foo foo.o
gcc -c foo.c
I don’t use kdevelop, but there should be some dialog where you can
configure link and include flags, add the "sdl-config --cflags/libs"
stuff there and it should work. Or write a real Makefile and use this
Also check this: