Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc: How to ignore standard include paths?

Tags:

gcc

I need to compile some files with a usage of modified versions of standard library headers. With Visual C++ compiler I will do this by usage of /X (Ignore Standard Include Paths) and /I (Additional Include Directories) parameters. How this should be done with gcc?

like image 829
okutane Avatar asked Jun 07 '10 10:06

okutane


People also ask

What is my include path?

includePath An include path is a folder that contains header files (such as #include "myHeaderFile. h" ) that are included in a source file. Specify a list of paths for the IntelliSense engine to use while searching for included header files.

Where does gcc look for include files?

GCC looks for headers requested with #include " file " first in the directory containing the current file, then in the directories as specified by -iquote options, then in the same places it would have looked for a header requested with angle brackets. For example, if /usr/include/sys/stat. h contains #include "types.

What is Sysroot GCC?

A sysroot is a folder which contains a minimal filesystem (especially libraries, the C library and header files). An example sysroot could look like this: 'sysroot/usr', 'sysroot/usr/lib', 'sysroot/usr/include'.

Which option in GCC is used to specify the location of the .h files?

gcc -I adds include directory of header files.


1 Answers

gcc -nostdinc -I/custom/include/path/goes/here 

-nostdinc ignores standard C include directories
-nostdinc++ ignores standard C++ include directories

like image 85
mmx Avatar answered Oct 14 '22 11:10

mmx