How to include a library

Olaf Hartig OleBowle at gmx.de
Thu May 17 23:33:28 BST 2001


Am Donnerstag 17 Mai 2001 23:06 schrieb Willy Gardiol:
> i started looking at the SDL library (thanks Zdenek) and it seems very
> easy... but i have a problem, i use KDevelop, i have a bit of confusion
> about libraries under linux:
> libSDL.a should be the static version of the library, the one i need to
> link to my project, i think, i am right? if so, how could i link it? i
> tryed to add "libSDL.a" in the linker options tab in the project options
> dialog but i always get a message like:
> gmake[2]: *** No rule to make target `libSDL.a', needed by `cavpro'.  Stop.
> why?
> this was a simple task in dos or iwndows enviroments i am a bit confused by
> all those configuration files in the project dir...
>
> libSDL.so should be the dinamic version of the library, if so how could i
> use it? Under microsoft enviroments i hat do LoadLibrary and GetProcAddress
> but under linux?
>
> sorry for the stupid and basic questions...

You should use the dynamic library. In your KDevelop project you open the 
"Project Options"-Dialog with F7 and add the following things.

to "Compiler Options"->"additional options" add 
	-I/usr/include/SDL
means: where to look for the SDL-header-files

to "Linker Options"->"additional libraries" add
	-lSDL
means: which library to link additionally

Now include the SDL-include files needed in your sources like:
	#include <SDL_video.h>

That's it

Ole

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list