gpt4 book ai didi

ios - 找不到用于 clang 构建 Mac Catalyst 的 UIKit/UIKit.h

转载 作者:行者123 更新时间:2023-11-29 05:08:39 27 4
gpt4 key购买 nike

我正在使用以下标志为 Mac Catalyst 构建静态 iOS/macOS 库:

clang \
--target=x86_64-apple-ios13-macabi \
-isysroot /Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk

这会构建普通源文件,但失败并显示:

#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
#import <UIKit/UIKit.h>
#endif

由于定义了 TARGET_OS_IPHONE,因此看起来目标标志正在工作。然而,没有找到 UIKit/UIKit.h,即使它在 SDK 中:

$ find -L /Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -name UIKit.h
/Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/System/Library/Frameworks/UIKit.framework/Versions/A/Headers/UIKit.h
/Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/System/Library/Frameworks/UIKit.framework/Versions/Current/Headers/UIKit.h
/Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h

我需要明确指定 UIKit 框架吗?

最佳答案

使这项工作有效的双重 secret build设置是:

FAT_LIB_MAC_CATALYST_FLAGS = -arch x86_64h \
--target=x86_64-apple-ios13-macabi \
-isysroot $(MACOSX_SDK_DIR) \
-isystem $(MACOSX_SDK_DIR)/System/iOSSupport/usr/include \
-iframework $(MACOSX_SDK_DIR)/System/iOSSupport/System/Library/Frameworks

关于ios - 找不到用于 clang 构建 Mac Catalyst 的 UIKit/UIKit.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59903554/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com