$ cat t1.c
#include <CoreFoundation/CoreFoundation.h>
$ gcc t1.c
In file included from /usr/include/dispatch/dispatch.h:51,
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 t1.c:1:
/opt/local/lib/gcc9/gcc/x86_64-apple-darwin14/9.2.0/include-fixed/dispatch/object.h:373:3: error: unknown type name 'dispatch_block_t'; did you mean 'dispatch_object_t'?
373 | dispatch_block_t notification_block);
| ^~~~~~~~~~~~~~~~
| dispatch_object_t有什么帮助吗?
发布于 2022-04-22 07:32:49
尝试使用clang,而不是gnu gcc。当我使用/usr/local/bin/gcc作为编译器时,遇到了同样的问题。转向/usr/local/clang,解决我的问题。
https://stackoverflow.com/questions/70887083
复制相似问题