Mac OS X 10.9 with GCC 4.7.3, stdlib.h: no such file or directory

Posted by Leon Kaihua Li on Stack Overflow See other posts from Stack Overflow or by Leon Kaihua Li
Published on 2013-10-19T15:38:16Z Indexed on 2013/10/19 15:54 UTC
Read the original article Hit count: 350

Filed under:
|
|
|
|

I'm doing some development with C++ on Mac OS. The code worked fine on Mac OS 10.8.3/10.8.4, with GCC 4.7.3.

However recently I upgraded my OS to Mavericks 10.9 and Xcode 5.0. I find that when I try to compile my code, both gcc/g++/clang responds with:

*******.C:1:** stdlib.h:no such file or directory
*******.C:2:** iostream.h:no such file or directory

Since I'm not familiar with Mac OS(My working platform is openSUSE), what can I do for it? will it help if I install "Command Line Tools" from Xcode? Or is there anyway that I could re-build the include index?

Include dir of GCC is /opt/local/include/gcc47 and it seems there is a stdlib.h in it. The path is /opt/local/include/gcc47/c++/tr1/

Please help me, and thank you very much.

© Stack Overflow or respective owner

Related posts about c++

Related posts about xcode