Where are header files for GCC located?

First take a look in /usr/include or /usr/local/include.

If you find nothing there, try :

`gcc -print-prog-name=cc1plus` -v

This command asks gcc which C++ preprocessor it is using, and then asks that preprocessor where it looks for includes.

You will get a reliable answer for your specific setup.

Likewise, for the C preprocessor:

`gcc -print-prog-name=cc1` -v

To look for header locations just use the locate command:

locate -b '\math.h'
locate -b '\graphics.h'

or a simpler approach

locate \*/math.h
locate \*/graphics.h

If you are more familiar with regular expression use

locate -r \/math.h$

To make sure the database is up-to-date start:

sudo updatedb

That's the way I'm searching my headers location. It's much faster than using the find command.

Tags:

C

Gcc

Compiler