Mac OS X 10.9 with GCC 4.7.3, stdlib.h: no such file or directory
- by Leon Kaihua Li
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.