Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include needed C library using gcc?

Tags:

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>?

like image 948
multiholle Avatar asked May 16 '11 11:05

multiholle


People also ask

Which gcc option is used to link the library?

The -l option tells gcc to link in the specified library.

Where are libraries gcc?

The standard system libraries are usually found in the directories '/usr/lib' and '/lib'. For example, the C math library is typically stored in the file '/usr/lib/libm.

Does gcc come with standard library?

If you need a Standard compliant library, then you need to find one, as GCC does not provide one.


1 Answers

-I<search path to include files> -L<search path to the lib file> -l<libname> 
like image 177
Kristofer Avatar answered Sep 20 '22 15:09

Kristofer