我将yesteday升级到最新的MonoTouch / MonoDevelop构建,现在我的应用程序在编译时抛出以下错误:
error MT5201: Native linking failed. Please review user flags provided to gcc: "-lz" "-lxml2"
我在构建时使用以下内容,因为我使用的链接库需要libz.dylib。 -gcc_flags“-lz -lxml2”
我目前的环境是:
MonoDevelop 3.0.5
Installation UUID: 5022d668-f236-4223-a074-6c050535bd3f
Runtime:
Mono 2.10.9 (tarball)
GTK 2.24.10
GTK# (2.12.0.0)
Package version: 210090011
Apple Developer Tools:
Xcode 4.5.2 (1847)
Build 4G2008a
Monotouch: 6.0.7
Mono for Android: Not Installed
Build information:
Release ID: 30005000
Git revision: e159cf083bd327933166819d94245298898d6e3d
Build date: 2012-10-24 16:43:06+0000
Xamarin addins: eea2ed91ae8dd242b281d5ec8f6c2fbc63b4cd3d
Operating System:
Mac OS X 10.7.5
Darwin My-Mac-mini-2.local 11.4.2 Darwin Kernel Version 11.4.2
Thu Aug 23 16:25:48 PDT 2012
root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
除了MonoTouch / MonoDevelop更新到最新的稳定版本之外,最初没有任何改变。在更新时,我不得不重新许可MonoTouch所以我这样做,所有安装都很好。比在构建上它失败了。我比更新Xcode希望解决它,因为我在最新的Xcode上,但事实并非如此。
不相关,这不是我更新后唯一的问题。在另一个项目中,我的观点显示在90度旋转,但不要担心。只是提一下,以防它可能有助于解决问题,因为我的升级可能出了问题?
添加构建错误信息:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++ -arch i386 -gdwarf-2 -fobjc-legacy-dispatch -fobjc-abi-version=2 -miphoneos-version-min=6.0 -arch i386 -std=c99 -I/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -c /var/folders/ln/yb817btn4_s7b52rhfk80cmm0000gn/T/tmp478d0592.tmp/main.i386.m -o /Users/Company/Projects/App/4-PDF2/App.Kiosk/obj/Debug/mtouch-cache/main..i386.cache.xT4QTbvqc0Zrv4eGTYvIJcXuuvo=.o
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++ -Wl,-no_pie -arch i386 -gdwarf-2 -fobjc-legacy-dispatch -fobjc-abi-version=2 -miphoneos-version-min=6.0 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk /Users/Company/Projects/App/4-PDF2/App.Kiosk/obj/Debug/mtouch-cache/main..i386.cache.xT4QTbvqc0Zrv4eGTYvIJcXuuvo=.o -o /var/folders/ln/yb817btn4_s7b52rhfk80cmm0000gn/T/tmp478d0592.tmp/AppKiosk -framework CFNetwork -framework AssetsLibrary -framework Accounts -framework CoreBluetooth -framework CoreTelephony -framework EventKit -framework EventKitUI -framework Foundation -framework CoreMotion -framework GameKit -framework GLKit -framework iAd -framework MapKit -framework MediaPlayer -framework MessageUI -framework NewsstandKit -framework OpenGLES -framework Social -framework StoreKit -framework Twitter -framework UIKit -framework PassKit -framework AddressBookUI -framework SystemConfiguration -framework AddressBook -framework AudioToolbox -framework AVFoundation -framework QuartzCore -framework CoreGraphics -framework CoreImage -framework CoreLocation -framework CoreText -framework ImageIO -framework MobileCoreServices -framework Security -framework CoreData -framework CoreMedia -framework CoreMIDI -framework CoreVideo -framework ExternalAccessory -framework AdSupport -framework QuickLook -lz -u _mono_pmip -u _CreateZStream -u _CloseZStream -u _Flush -u _ReadZStream -u _WriteZStream -u _monotouch_create_managed_ref -u _monotouch_release_managed_ref -liconv -lmonosgen-2.0 -lmonotouch-sgen -L/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib -lmono-profiler-log -u _mono_profiler_startup_log -u _catch_exception_raise -force_load /var/folders/ln/yb817btn4_s7b52rhfk80cmm0000gn/T/tmp478d0592.tmp/libPSPDF-ios5.1.a -force_load /var/folders/ln/yb817btn4_s7b52rhfk80cmm0000gn/T/tmp478d0592.tmp/libBARCODE-iphoneos.a "-lz" "-lxml2"
Process exited with code 1, command:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++ -Wl,-no_pie -arch i386 -gdwarf-2 -fobjc-legacy-dispatch -fobjc-abi-version=2 -miphoneos-version-min=6.0 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk /Users/Company/Projects/App/4-PDF2/App.Kiosk/obj/Debug/mtouch-cache/main..i386.cache.xT4QTbvqc0Zrv4eGTYvIJcXuuvo=.o -o /var/folders/ln/yb817btn4_s7b52rhfk80cmm0000gn/T/tmp478d0592.tmp/AppKiosk -framework CFNetwork -framework AssetsLibrary -framework Accounts -framework CoreBluetooth -framework CoreTelephony -framework EventKit -framework EventKitUI -framework Foundation -framework CoreMotion -framework GameKit -framework GLKit -framework iAd -framework MapKit -framework MediaPlayer -framework MessageUI -framework NewsstandKit -framework OpenGLES -framework Social -framework StoreKit -framework Twitter -framework UIKit -framework Paerror MT5201: Native linking failed. Please review user flags provided to gcc: "-lz" "-lxml2"
ssKit -framework AddressBookUI -framework SystemConfiguration -framework AddressBook -framework AudioToolbox -framework AVFoundation -framework QuartzCore -framework CoreGraphics -framework CoreImage -framework CoreLocation -framework CoreText -framework ImageIO -framework MobileCoreServices -framework Security -framework CoreData -framework CoreMedia -framework CoreMIDI -framework CoreVideo -framework ExternalAccessory -framework AdSupport -framework QuickLook -lz -u _mono_pmip -u _CreateZStream -u _CloseZStream -u _Flush -u _ReadZStream -u _WriteZStream -u _monotouch_create_managed_ref -u _monotouch_release_managed_ref -liconv -lmonosgen-2.0 -lmonotouch-sgen -L/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib -lmono-profiler-log -u _mono_profiler_startup_log -u _catch_exception_raise -force_load /var/folders/ln/yb817btn4_s7b52rhfk80cmm0000gn/T/tmp478d0592.tmp/libPSPDF-ios5.1.a -force_load /var/folders/ln/yb817btn4_s7b52rhfk80cmm0000gn/T/tmp478d0592.tmp/libBARCODE-iphoneos.a "-lz" "-lxml2"
ld: file not found: /var/folders/ln/yb817btn4_s7b52rhfk80cmm0000gn/T/tmp478d0592.tmp/libBARCODE-iphoneos.a
collect2: ld returned 1 exit status
答案 0 :(得分:1)
错误MT5201:原生链接失败。请查看提供给gcc的用户标志:“ - lz”“ - lxml2”
这意味着本机链接器失败。最常见(但不是唯一)的原因是人们改变他们的选择。这就是为什么第一个要检查你的用户标志(它们看起来都很好)。
下一步是了解本机链接器失败的原因。为此,您需要查看构建输出(您可以在MonoDevelop的错误列表中查看)。
检查是否有任何警告(在日志或内部MD错误列表板上)。那里可能还有一些额外的信息。
您之前使用的是什么版本的Xcode? (即在更新之前)
Xcode 4.5仅适用于ARMv7(和ARMv7s),所以如果您使用Xcode 4.4(或更早版本),您可能会尝试使用仅适用于ARMv6的第三方绑定。这是本机链接器不喜欢的东西(你应该在构建日志中看到警告)。