Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode -dynamic not specified static library error

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?

like image 884
Sammio2 Avatar asked Mar 11 '14 09:03

Sammio2


1 Answers

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).

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)

[Edit]: please commit your project's git or do whatever you do to make a backup from your project, there is a chance that Xcode may break your project with no reason after removing these dynamic libraries and NO, deleting project's Derived data won't solve the problem.

like image 71
M. Porooshani Avatar answered Oct 12 '22 13:10

M. Porooshani