GCC can't find header files

Ryan Schmidt ryandesign at macports.org
Sat Mar 3 11:48:53 PST 2012


On Mar 3, 2012, at 10:38, Miguel Lacerda wrote:

> I am trying to compile source code that I downloaded from a developer's website. I have installed the lastest version of MacPorts (after installing Xcode 4.3) and port installed cmake and gcc46 as required. Cmake completes without any errors. However, it seems that the compiler is unable to find standard header files (e.g. string.h, stdio.h, etc) when I issue the "make" command (see error messages below). I have checked that /opt/local/include is in my path

If you're talking about the $PATH environment variable, then it only contains paths to executable programs; it does not have anything to do with paths to libraries or include files (headers).

> and that the header files are in fact there. I am running OS X Lion.
> 
> What am I missing? 
> 
> Any help would be greatly appreciated. 
> Miguel
> 
> 
> 
> Miguels-MacBook-Pro:veg-hyphy-569d1ed miguel$ make MP2
> Scanning dependencies of target HYPHYMP
> [  0%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/avllist.cpp.o
> In file included from /Users/miguel/Desktop/veg-hyphy-569d1ed/src/core/include/avllist.h:43,
>                 from /Users/miguel/Desktop/veg-hyphy-569d1ed/src/core/avllist.cpp:33:
> /Users/miguel/Desktop/veg-hyphy-569d1ed/src/core/include/simplelist.h:43:20: error: string.h: No such file or directory

This file is on my Snow Leopard system as /usr/include/string.h. Is it there on your system? If not, have you installed the Xcode command line tools? If not, do so.




More information about the macports-users mailing list