我尝试在OSX 10.5.8下使用CFLocaleCopyCurrent,但出现奇怪的错误:

#include <CoreFoundation/CoreFoundation.h>

int main(int argc, char **argv){
    setlocale(LC_ALL, "");
    CFLocaleRef loc = CFLocaleCopyCurrent();
    return 0;
}

Undefined symbols:
"_CFLocaleCopyCurrent", referenced from: _main in ccn51XwH.o

最佳答案

尝试/usr/bin/gcc -framework Foundation test.c

07-28 02:36