【发布时间】:2011-09-20 08:36:46
【问题描述】:
我在 xcode 工作区中有 2 个项目。一个是静态库,一个是使用静态库。
在静态库中,我添加了我在主项目中使用的 GDataXMLNode.h 和 GDataXMLNode.m 文件。 GDataXMLNode.h 是一个公共文件,因此它在主项目中可见。我还将两个项目的目标与 libxml2.dylib 相关联。我还在标题搜索路径和用户标题搜索路径中包含位置 /usr/include/libxml2。
尽管这些,我得到一个 Apple Mach-O Librarian 错误:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool: can't locate file for: -lxml2
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool: file: -lxml2 is not an object file (not allowed in a library)
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool: file: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/libxml2.dylib is a dynamic library, not added to the static library
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool: file: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/libxml2.dylib is a dynamic library, not added to the static library
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool: file: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/libz.dylib is a dynamic library, not added to the static library
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool: file: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/libz.dylib is a dynamic library, not added to the static library
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool failed with exit code 1
你知道我该如何解决这个问题吗?
【问题讨论】:
-
现在速度很快,尽管我从昨天开始就在尝试。我设法通过从构建设置中删除它来修复它: OTHER_LDFLAGS = "-lxml2";祝你一切顺利!
标签: iphone objective-c ios libxml2