0

I can't find the stdio.h file. I am using Linux Mint 18.2 XFCE and gcc-7.2 compiler.

Here is output of find . -type f -name stdio.h

smit@smit-Aspire-5742:/usr/lib/gcc$ find . -type f -name stdio.h
./i686-w64-mingw32/5.3-win32/include/ssp/stdio.h
./i686-w64-mingw32/5.3-win32/include/c++/tr1/stdio.h
./i686-w64-mingw32/5.3-posix/include/ssp/stdio.h
./i686-w64-mingw32/5.3-posix/include/c++/tr1/stdio.h
./x86_64-w64-mingw32/5.3-win32/include/ssp/stdio.h
./x86_64-w64-mingw32/5.3-win32/include/c++/tr1/stdio.h
./x86_64-w64-mingw32/5.3-posix/include/ssp/stdio.h
./x86_64-w64-mingw32/5.3-posix/include/c++/tr1/stdio.h

I don't want the mingw files. It's a cross compiler that I rarely use. I can't find gcc-7.2's stdio.h file. Am I looking in wrong directory?

3
  • Use locate to find files... Commented Sep 5, 2017 at 4:51
  • @MarcGlisse Means???
    – user8435497
    Commented Sep 5, 2017 at 5:22
  • There is that thing called g**gle, if you type locate+linux in it, it gives plenty of information. Commented Sep 5, 2017 at 6:38

3 Answers 3

5

You are looking in the wrong location. stdio.h is not located in /usr/lib/gcc but in /usr/include

<> Is basically a shortcut to /usr/include (or any directory you specify after the -I compiler flag) in C/C++. So

#include <myheader.h>

would include /usr/include/myheader.h and

#include <file/otherheader.h> 

Would include /usr/include/file/otherheader.h This means that since you normally include stdio.h with

#include <stdio.h>

the location would be /usr/include/stdio.h

0
0

By default, gcc looks in different directories :

 /usr/local/include
 libdir/gcc/target/version/include
 /usr/target/include
 /usr/include

You can take a look at the documentation.

-1

It's an .h file it is a header, thus, /usr/include/stdio.h ?

1
  • @SMIT PATIL: sry, a typo
    – Solo
    Commented Sep 8, 2017 at 8:54