Question

I Have found a source file bundle with a Makefile, I went through it, and In CFLAG Variable, There is a FLAG -I , I have searched on the web, But couldn't find what it actually does. Is it something relevent to the library files included in the C file? ( stdio.h,unistd.h, pthread.h )

Please point me to a source or explain in brief, What does the Flag -I does?

-Regards

Was it helpful?

Solution

It's right there in the man page of gcc (called with man gcc on unix/linux or you can find it via Google):

-I dir

Add the directory dir to the list of directories to be searched for header files. Directories named by -I are searched before the standard system include directories. If the directory dir is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system headers are not defeated . If dir begins with "=", then the "=" will be replaced by the sysroot prefix; see --sysroot and -isysroot.

(The exact text and semantics may differ between versions of gcc)

Alternatively there is also the gcc documentation online: http://gcc.gnu.org/onlinedocs/ The option for version 4.8.2, as an example, can be found here: http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Directory-Options.html#Directory-Options

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top