c++macos

f2c compilation problem: cc1plus error: /include: not a directory What does this mean?


I am having problems with compiling code on my Mac (OS X, 10.6.5).

The code uses f2c.

I wondered if it might be a problem with my compiler, and just in case I reinstalled Xcode, which installs a new g++ compiler. But I still get the same error.

Here's the error:

cc1plus: error: /include: not a directory
cc1plus: error: /lib: not a directory
make: *** [Task1.o] Error 1

Solution

  • This may be an error in the installation of your gcc compiler. It seems it may be looking for includes in /usr/include, but it is missing the first part of the directory. Try executing:

    $ gcc -v
    

    to see what directories the gcc you're using has by default. In my case, I see

    --prefix=/usr
    

    as one of the options.