1
votes

I was trying to install gcc and gfortran on my intel mac with mountain lion and keep getting the above error when trying to compile the fortran file. gcc doesn't seem to work either with c programs. This is the error I get with my c program:

test.c:1:19: fatal error: stdio.h: No such file or directory

I tried typing this into terminal:

export PATH=${PATH}:/usr/local/bin

but that did not work. I added gcc and gfortran to /usr/local/bin instead of /usr/bin. I downloaded the compilers through hpc. The files had the given directory structure:

/usr/local/bin: contained gcc and gfortran along with other compilers
/uer/local/include/...
/usr/local/lib/...
etc...

I pretty much just copied and pasted all the files directly over to the exact same path directories on my computer and ran the export command. That is all I have done.

1
what do you get when you do which as at the command line?perreal
you need binutils (gnu.org/software/binutils)perreal
ok, I downloaded binutils but I am not exactly sure where to put it.user972276
also, this is the error I got from trying to compile a c program: test.c:1:19: fatal error: stdio.h: No such file or directoryuser972276
you can put as near gcc, i.e., in the same directory.perreal

1 Answers

2
votes

You probably need either odcctools (as provided by macports) or XCode (which contains the Mac "binutils", and the Clang compiler, GCC was discontinued).