1

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.

8
  • what do you get when you do which as at the command line? Commented Sep 12, 2012 at 20:09
  • 1
    you need binutils (gnu.org/software/binutils) Commented Sep 12, 2012 at 20:13
  • ok, I downloaded binutils but I am not exactly sure where to put it. Commented Sep 12, 2012 at 20:21
  • 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 directory Commented Sep 12, 2012 at 20:27
  • you can put as near gcc, i.e., in the same directory. Commented Sep 12, 2012 at 20:34

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.