mac os 迁移后,编译链接foundation的qt 项目失败

error: unknown type name 'CFAttributedStringRef'; did you mean 'NSAttributedStringKey'?
CFAttributedStringRef attrString ) CT_AVAILABLE(macos(10.5), ios(3.2), watchos(2.0), tvos(9.0));
^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:22:20: note: 'NSAttributedStringKey' declared here
typedef NSString * NSAttributedStringKey NS_TYPED_EXTENSIBLE_ENUM;
^

sonoma 默认的sdk是14.x
切换回较旧版本的sdk后就正常了

-DCMAKE_OSX_SYSROOT:PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk
posted @ 2024-07-06 13:35  马肯尼煤牙巴骨  阅读(38)  评论(0编辑  收藏  举报