views:

18

answers:

1

Normally when linking against a static library, I have to specify a library directory and the name of a libX.so (or its symbolic link) as -lX flag for linking [and its directory with -L flag].

Can I automate this based on my header files (in c/c++) only? Or maybe it is not a good idea? Is there a software for locating the -L and -l parameters automatically? Is some table stored somewhere on the system about this on popular linux systems or even cygwin?

+1  A: 

You should use pkg-config.

el.pescado
That's right. Apparently I could just use:`gcc -o test test.c $(pkg-config --libs --cflags libpng)`(from wikipedia http://en.wikipedia.org/wiki/Pkg-config )
kavic
Ok, `qi-make` may be useful one day as wel [but is a different thing]:http://code.google.com/p/qi-make/
kavic