uchar.h file not found on OS X 10.9

后端 未结 2 1504
-上瘾入骨i
-上瘾入骨i 2021-02-07 14:26

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.         


        
相关标签:
2条回答
  • 2021-02-07 14:40

    Try this:

    cc -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/include -L/usr/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/lib -licucore /tmp/esc.c
    

    If it didn't work, I suggest that you install "International Components for Unicode":

    1) Install Macports for OS X
    2) Run this in Terminall app: "port install icu"
    

    It gives you all needed components for Unicode, including "/opt/local/include/unicode/uchar.h"

    Then find appropriate options for cc:

    /opt/local/bin/icu-config --cppflags-searchpath --ldflags --ldflags-icuio
    

    Which gives you:

    -I/opt/local/include -L/opt/local/lib -licui18n -licuuc -licudata -licuio  
    

    So you compile your program as:

    cc -I/opt/local/include -L/opt/local/lib -licui18n -licuuc -licudata -licuio /tmp/esc.c
    

    I'm not sure, but probably getting icu from it's website might also work for you:

    http://site.icu-project.org/download

    0 讨论(0)
  • 2021-02-07 14:54

    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.

    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.

    0 讨论(0)
提交回复
热议问题