我正在尝试在我的 Mac 上对 C++ 程序进行“干净”构建。我的意思是干净,不要包括我没有明确指定的任何内容。
我的 gcc 安装位于:
/Applications/gcc471/
到目前为止,我可以编译使用
-nostdinc++
通过包括
GPP-INCLUDES += -I/Applications/gcc471/include/c++/4.7.1/
GPP-INCLUDES += -I/Applications/gcc471/include/c++/4.7.1/x86_64-apple-darwin12.0.0
和做
g++ -c *.cpp $(GPP-INCLUDES) -nostdinc++
我对此很满意。但是,我正在尝试使用
-nostdinc
看来,无论我包含多少条路径
/usr/local/include
/usr/include
....
我收到一大堆这样的错误:
/Applications/gcc471/include/c++/4.7.1/tr1/cmath: At global scope:
/Applications/gcc471/include/c++/4.7.1/tr1/cmath:156:11: error: ‘::double_t’ has not been declared
/Applications/gcc471/include/c++/4.7.1/tr1/cmath:157:11: error: ‘::float_t’ has not been declared
/Applications/gcc471/include/c++/4.7.1/tr1/cmath:160:11: error: ‘::acosh’ has not been declared
...
有谁知道如何在mac上使用-nostdinc从头开始完全构建一个cpp程序?