Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/137.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何编译和链接MacPort';s libstdc++;在Xcode中?_C++_Xcode_Std_Macports_Libstdc++ - Fatal编程技术网

C++ 如何编译和链接MacPort';s libstdc++;在Xcode中?

C++ 如何编译和链接MacPort';s libstdc++;在Xcode中?,c++,xcode,std,macports,libstdc++,C++,Xcode,Std,Macports,Libstdc++,我刚刚通过MacPorts升级了我的gcc发行版,我想用Xcode的clang++使用最新的libstdc++4.7(它支持我感兴趣的许多C++11特性)。显然,通过MacPorts的select命令激活新的gcc4.7是不够的,因为Xcode一直在抱怨缺少头,例如 #include<random> 'random' file not found #包括 找不到“随机”文件 我已经设置了附加标题目录(MacPorts默认根目录/opt/local/include)和附加库目录(

我刚刚通过MacPorts升级了我的gcc发行版,我想用Xcode的clang++使用最新的libstdc++4.7(它支持我感兴趣的许多C++11特性)。显然,通过MacPorts的
select
命令激活新的gcc4.7是不够的,因为Xcode一直在抱怨缺少头,例如

#include<random>

'random' file not found
#包括
找不到“随机”文件

我已经设置了附加标题目录(MacPorts默认根目录
/opt/local/include
)和附加库目录(MacPorts默认根目录
/opt/local/lib
),但是,看起来XCODE很难识别它的C++头在<代码> /opt/PATION/CARCK/C42/C++ +/<代码>。我需要这方面的帮助。您是否用gcc-v验证了select命令,以及要查看哪个gcc编译器的位置?