为什么使用GCC5的MacOSX Mojave 10.14中缺少CharConv头球
Why is charconv header missing in macosx Mojave 10.14 with gcc5?
我正在尝试在C 中进行一些非常快速的转换,并且CharConv似乎是使用非常低的逻辑,因此是要走的。问题在于,当我尝试包含此标头,然后打电话给std :: to_chars(...)时,没有找到标头,而std也没有" to_chars"成员。我更新并重新安装了海湾合作委员会,但此问题仍然存在。现在,我看到了一些线程,说我应该以某种方式更新libc 17,但是它们对我应该做的事情并不是很具体,因为Macos的情况有些不同。
。一些用于说明库的代码,并且使用:
#include <iostream>
#include <typeinfo>
#include <charconv> //error: 'charconv' file not found
struct to_chars_result{
char *str;
std::errc err;
};
int main(int argc, const char * argv[]) {
std::string str("12Test");
auto result = std::to_chars(str.data(), str.data()+str.size(), 12345); //No
//member named 'to_chars' in namespace 'std'.
return 0;
}
至于gcc -v命令输出:
collect_gcc = gcc collect_lto_wrapper =/usr/locar/libexec/gcc/x86_64-apple-darwin14.4.4.0/5.1.0/lto- 包装纸 Ziel:X86_64-APPLE-DARWIN14.4.0 konfiguriert mit:../gcc-5.1.0/configure -enable-languages = c ,fortran 线程模式:posix GCC-Version 5.1.0(GCC)
任何帮助!
GCC 5.1于2015年4月22日发布。
在2016年编写了to_chars
的论文。
您为什么希望GCC5能够实施?
[稍后:那是添加<charconv>
标头的论文]