xcode c语言 字符集,在Xcode 4.5中,“C标准库”和“C语言方言”的“编译器默认”是什么?...

Xcode 4.5中“C标准库”和“C语言方言”的“编译器默认值”有什么价值?

我的猜测是libstdc和GNU 98,但澄清一下会很好.

Projects created using this Xcode release use the new libc++

implementation of the standard C++ library. The libc++ library is

available only on iOS 5.0 and later and OS X 10.7 and later. 12221787

To enable deployment on earlier releases of iOS and OS X in your

project, set the C++ Standard Library build setting to libstdc++ (Gnu

C++ standard library).

我注意到创建一个新项目显式设置GNU 11和libc,但“编译器默认”可能是其他东西.

解决方法:

以下是了解最佳方法:

#include

int main()

{

#ifdef _LIBCPP_VERSION

std::cout << "Using libc++\n";

#else

std::cout << "Using libstdc++\n";

#endif

#ifdef __GXX_EXPERIMENTAL_CXX0X__

#if __cplusplus == 1

std::cout << "Language mode = gnu++11\n";

#else

std::cout << "Language mode = c++11\n";

#endif

#else

#if __cplusplus == 1

std::cout << "Language mode = gnu++98\n";

#else

std::cout << "Language mode = c++98\n";

#endif

#endif

}

只需使用编译器默认值构建一个测试项目并运行它.

标签:c,c11,xcode,libc-2,libstdc

来源: https://codeday.me/bug/20190725/1537111.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值