我在一个xcode工作空间中有两个项目。其中一个是静态库,另一个使用该静态库。
在静态库中,我添加了GDataXMLNode.h和GDataXMLNode.m文件,并在主项目中使用它们。 GDataXMLNode.h是公共文件,因此在主项目中可见。我还将两个项目的目标与libxml2.dylib链接。同时,我在头文件搜索路径和用户头文件搜索路径中包含了/usr/include/libxml2的位置。
尽管如此,我仍然遇到了Apple Mach-O Librarian错误:
在静态库中,我添加了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
你知道我该怎么修复这个问题吗?