OSX 10.5.8下的未定义符号错误

时间:2012-07-21 14:19:54

标签: c xcode macos gcc

我尝试在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

1 个答案:

答案 0 :(得分:1)

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