我在xcode工作區中有2個項目。一個是靜態庫,另一個使用靜態庫。iphone - 「.../libtool:無法找到文件:-lxml2」
在靜態庫中,我添加了在主項目中使用的GDataXMLNode.h和GDataXMLNode.m文件。 GDataXMLNode.h是一個公共文件,因此它在主項目中可見。我還將這兩個項目的目標與libxml2.dylib鏈接起來。我還在頭部搜索路徑和用戶頭部搜索路徑中包含位置/ usr/include/libxml2。
儘管這些,我得到一個蘋果的Mach-O庫錯誤:
/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」; 祝你一切順利! – Bogdan