I use VM and ubuntu to do my homework. After I decompress my file and run it, I find some error. To fix the error, I need to find the stdio.h and modify it. However, I can't find the files "stdio.h". The terminal indicates /usr/include/stdio.h:781:12.....error. My problem is that the stdio.h seems to exist under include but I can't find it, but not that it doesn't exist.(or the error would indicate "can't find stdio.h"?) I have googled it and install build-essential again, but it still can't work.

Does anyone know how to fix it?


To fix the error, I need to find the stdio.h and modify it.

You should modify your program to get it to work with the version of stdio.h that you have, not vice versa. I recommend asking another question regarding the compilation error you get against the stock stdio.h.

However, I can't find the files "stdio.h".

In Ubuntu, the stdio.h file is provided by the package libc6-dev, which should be required by build-essential. So that file really ought to be there. You might not have permission to edit it as a normal user, but you can probably do so with sudo if you really want to.


If it is only about - literally - how to find a file, the command

find / -name stdio.h

Will find it for you. (read the man page, it is a very useful tool)

p.s. the standard location on *nix systems would be /usr/include/stdio.h, i.e., #include looks in /usr/include and other -I directories passed as arguments to the compiler.


Use this command to find stdio.h

locate stdio.h
  • stdio.h is not part of gcc. – Johan Myréen Nov 26 '16 at 7:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.