在OS X 10.9上找不到uchar.h文件 [英] uchar.h file not found on OS X 10.9

查看:69
本文介绍了在OS X 10.9上找不到uchar.h文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给我的印象是我的C编译器支持C11,因为它接受-std = c11标志,

I'm under the impression my C compiler supports C11 since it accepts the -std=c11 flag,

$ cc --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

uchar.h 是C11标准的一部分,所以我希望这个程序可以编译,

and uchar.h is part of the C11 standard, so I'd expect this program to compile,

$ cat /tmp/esc.c 
#include <uchar.h>

int main(void) {}

但是

$ cc /tmp/esc.c 
/tmp/esc.c:1:10: fatal error: 'uchar.h' file not found
#include <uchar.h>
         ^
1 error generated.

我试图找到uchar.h文件,但系统上唯一的问题来自iPhone SDK的怪异之处,

I tried locating the uchar.h file, but the only hits on my system are from iPhone SDK's weirdly,

$ locate uchar.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include/unicode/uchar.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/include/unicode/uchar.h

如何在OS X 10.9上使用 uchar.h ?我要下载一个新的编译器,还是滥用我的编译器?

How can I use uchar.h on OS X 10.9? Am I going to have to download a new compiler, or am I misusing the one I have?

推荐答案

Apple的macOS(包括Catalina 10.15以及更高版本)既没有< uchar.h> 也没有<线程.h> .它没有在< uchar.h> 中声明的4个函数或使用 char16_t char32_t 的任何其他函数.

Apple's macOS (up to and including Catalina 10.15) has neither <uchar.h> nor <threads.h>. It doesn't have the 4 functions declared in <uchar.h> or any other functions using char16_t or char32_t.

移植到需要这些功能的Mac的代码必须重写以避免使用它们(至少在macOS上使用),或者由有条件编译的代码提供支持,以提供在macOS上所需的功能.

Code ported to a Mac that needs those facilities must either be rewritten to avoid using them (at least on macOS) or be supported by conditionally compiled code that provides the facilities it needs on macOS.

这篇关于在OS X 10.9上找不到uchar.h文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆