I am trying to compile a simple "hello world" program with gcc on macOS and for some reason I get the error "fatal error: stdio.h: No such file or directory"
The interesting thing is that, if I compile using the entire path, so
/usr/bin/gcc hello.c
then everything works out fine. Although, if I run
which gcc
I get
/usr/local/bin/gcc
and with this path the compilation gives me the same error.
I used homebrew to install gcc, Xcode is up do date.
I really need to get this work, because I need to compile a code that uses both fortran and c modules, nd I have no idea how to modify the Makefile. Fortran compilation with gfortran works out fine. Thanks!