在升级我的操作系统和Yosemite的XCode之前,我曾经能够在用gcc编译时包含c ++文件中的Carbon头而没有错误:
#include <Carbon/Carbon.h>
int main()
{
return 0;
}
现在,在Yosemite上,这会使用clang++
进行编译,但会失败并显示g++
(通过macports安装4.7):
In file included from /usr/include/dispatch/dispatch.h:51:0,
from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15,
from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13,
from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:55,
from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19,
from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20,
from ./test.cpp.cpp:39:
/usr/include/dispatch/object.h:143:15: error: expected unqualified-id before '^' token
/usr/include/dispatch/object.h:143:15: error: expected ')' before '^' token
/usr/include/dispatch/object.h:362:3: error: 'dispatch_block_t' has not been declared
在使用GCC进行编译时,是否不再可能包含碳头?
答案 0 :(得分:0)
我认为Carbon仅为32位,而你的GCC本身就是64位,尝试使用-m32