gpt4 book ai didi

ios - Xcode -dynamic not specified static library 报错

转载 作者:技术小花猫 更新时间:2023-10-29 10:49:38 26 4
gpt4 key购买 nike

我在 Xcode 中有一个子项目,它创建了一个由父项目引用的静态库。一切都很好,直到 iOS 7.1 和 Xcode 5.1 发布,突然我收到以下警告。

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC 
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/lib/libsqlite3.0.dylib is a dynamic library, not added to the static library

有人知道我需要做什么来修复这个警告吗?

最佳答案

我认为解决方案在于动态库和静态库的基本概念。就库而言,动态库(在您的情况下为 libsqlite3.0.dylib)是系统库,您不需要将它们添加到静态库中!您需要做的就是在您希望在(您的应用程序)中使用它们的最终目标中添加它们的引用。

所以,简而言之:尝试从您的静态库中删除对 sqlite3.0.dylib 的引用(我猜您正在顶级应用程序中使用的另一个项目)并将其添加到您的应用程序(不是静态库),你可能很高兴。 (解决了我的问题)

[编辑]:请提交你的项目的 git 或做任何你做的事情来从你的项目中备份,Xcode 有可能在删除这些动态库后无缘无故地破坏你的项目并且不删除项目的派生数据不会解决问题。

关于ios - Xcode -dynamic not specified static library 报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22320911/

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