Xcode -dynamic未指定静态库错误 [英] Xcode -dynamic not specified static library error

查看:348
本文介绍了Xcode -dynamic未指定静态库错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a sub project within Xcode which creates a static library referenced by the parent project. All has been well until the release of iOS 7.1 and Xcode 5.1, suddenly I'm getting the following warning.

/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

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

Does anybody know what I need to do to fix this warning?

推荐答案

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

I think the solutions lies in the basic concept of dynamic and static libraries. as far as libraries go, dynamic libraries (libsqlite3.0.dylib in your case) are system libraries and you do not need to add them to your static library! all you need to do is to add their reference in your final Target you want to use them in (your application).

short:尝试从您的静态库中删除对 sqlite3.0.dylib 的引用(我猜想您在顶级应用程序中使用的另一个项目),并将其添加到您的应用程序(不是静态库),你可能很好去。 (解决我的问题)

so, in short: Try removing the reference to sqlite3.0.dylib from your static library (I'm guessing another project you are using inside your top level application) and add it to your application (not static library) and you're probably good to go. (solved my problem)


请提交你的项目的git或做任何你从项目中备份, Xcode可能会在删除这些动态库之后无理由地破坏您的项目,而且,删除项目的派生数据将无法解决问题。

这篇关于Xcode -dynamic未指定静态库错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆