Search code examples
gccstdio

fatal error: _stdio.h: No such file or directory


I'm compiling a open source N-body integrator (REBOUND, find it on github) in C using a makefile that has basically always worked. The makefile compiles the code fine on the supercomputer, but has recently stopped working on my personal computer.

I work on two computers, a new Macbook Pro and a slightly older iMac. Both computers have a homebrewed version of gcc 8.2.0 because the default Mac compiler lacks OpenMP.

Anyway, when I try to run the makefile on my personal computer I get an error in a file included in rebound.c (the base source file for REBOUND in the src/ directory). The error says that the stdio.h file included in rebound.c is trying to include a file _stdio.h which does not exist. Now, the specific stdio.h file that is causing this error is buried deep in the 8.2.0 gcc installation in the homebrew Cellar in a directory called "include-fixed". Indeed, if I go look at this stdio.h file, it does try to include a file _stdio.h

Can anyone tell me what's happening here? I've never seen a proceeding underscore in the name of a header file before. I'm almost inclined to believe that this is a typo in the stdio.h file in my gcc installation? I "brew upgrade"d gcc just to make sure I had a current version and I still get this error?

How do I fix this?


Solution

  • Same problem here.

    The intention is to load the actual system stdio.h, and “fix” the problems there. Apparently that didn't go well. Funny enough, loading the original /usr/include/stdio.h doesn't cause any problems, so simply removing the fixed file solves the problem.