.swiftinterface'没有这样的模块在xcframework中

发布于 2025-01-31 10:27:33 字数 925 浏览 5 评论 0原文

我一直在尝试从程序中构建XCFramework将C代码包装到SWIFT中,我需要它支持X86_64和ARM64 Archs用于MacOS。我已经成功地创建了一个.framework,将两个架构的两个二进制文件结合到单个通用脂肪文件中(如下所示),使用lipo -create -create -output任何Xcode项目都可以在开箱即用,我可以将其导入并使用它而无需大量问题。

sebasmontero@Sebastians-MBP faspio % lipo -info _builds/apple-universal/FaspIO.framework/FaspIO
Architectures in the fat file: _builds/apple-universal/FaspIO.framework/FaspIO are: x86_64 arm64

当我尝试使用完全相同的Universal .FrameWork生成XCFramework时,问题开始时开始。我正在运行xcodebuild -create -xcframework -framework /myframework.framework -output myxcframework.xcframework.xcframework < /code < /code < /code < /code>,并且XCFRAMEWORK成功地生成了。当我尝试将其包含在XCode项目中时,我在.swiftinterface文件上获得了一个“无模块”,特别是在将我的C代码包装并将其映射到Swift的导入模块中。

.../FaspIO.framework/Modules/FaspIO.swiftmodule/arm64-apple-macos.swiftinterface:4:8: No such module 'CFaspIO'

感谢任何帮助或指示!

I've been trying to build an XCFramework from my program that wraps C code into Swift and I need it to support both x86_64 and arm64 archs for MacOS. I have succeeded in creating a .framework that combines the two binaries from both architectures into a single universal fat file (as you can see below) using lipo -create -output and once I implement this .framework into any Xcode project, it works right out of the box and I'm able to import it and use it without major issue.

sebasmontero@Sebastians-MBP faspio % lipo -info _builds/apple-universal/FaspIO.framework/FaspIO
Architectures in the fat file: _builds/apple-universal/FaspIO.framework/FaspIO are: x86_64 arm64

The trouble begins when I try to generate an XCFramework using this exact same universal .framework. I'm running xcodebuild -create-xcframework -framework /myFramework.framework -output myXCFramework.xcframework as you do normally and the XCFramework is generated successfully, but. when I try including it in an Xcode Project, I get a 'No such module' on the .swiftinterface file, specifically in the imported module that wraps my C code and maps it into Swift.

.../FaspIO.framework/Modules/FaspIO.swiftmodule/arm64-apple-macos.swiftinterface:4:8: No such module 'CFaspIO'

I appreciate any help or pointers!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文