How to include needed C library using gcc?
I am trying to compile the simple C example from this Tutorial on Ubuntu using gcc. What do I have to use as argument for gcc to include the needed libraries for #include <libappindicator/app-indicator.h>
?
-I<search path to include files>
-L<search path to the lib file>
-l<libname>
Use the -l
command line option. You can specify the library search path with the -L
option. E.g:
gcc -o myprogram -lfoo -L/home/me/foo/lib myprogram.c
This will link myprogram
with the static library libfoo.a
in the folder /home/me/foo/lib
.