在xamarin中使用静态库时出错:错误:本机链接错误:找不到-lgcc_eh的库
我有一个静态库(arm64)的绑定,并将其添加为对xamarin studio中的单视图iOS项目的引用,但出现了一个与clang++相关的错误。我在附加的mtouch参数(最后一个)上尝试了不同的东西: 但我有一个错误: 本机链接错误:找不到-lgcc_eh的库 我不知道我的电脑缺了什么,我需要更新什么吗?我可以毫无问题地在XCode上运行本机代码 其他信息:在xamarin中使用静态库时出错:错误:本机链接错误:找不到-lgcc_eh的库,gcc,xamarin,xamarin.ios,clang++,Gcc,Xamarin,Xamarin.ios,Clang++,我有一个静态库(arm64)的绑定,并将其添加为对xamarin studio中的单视图iOS项目的引用,但出现了一个与clang++相关的错误。我在附加的mtouch参数(最后一个)上尝试了不同的东西: 但我有一个错误: 本机链接错误:找不到-lgcc_eh的库 我不知道我的电脑缺了什么,我需要更新什么吗?我可以毫无问题地在XCode上运行本机代码 其他信息: sdk版本9.3 链接器行为:链接所有 禁用的增量生成 部分日志: /Applications/Xcode.app/Contents/
sdk版本9.3
链接器行为:链接所有
禁用的增量生成 部分日志:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -framework UIKit -framework Foundation -framework CoreGraphics -weak_framework CFNetwork /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/libsmma_combo.a /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/libsmma.a /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonosgen-2.0.a /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libxamarin-debug.a /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/testface.exe.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/Xamarin.iOS.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/System.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/bind1.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/registrar.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/main.arm64.o -force_load /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libapp.a -licucore -lstdc++.6.0.9 -lgcc_eh -Wl,-pie -arch arm64 -miphoneos-version-min=9.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -lz -o /Users/bam/Projects/bind1/testface/bin/iPhone/Debug/testface.app/testface -liconv -lstdc++ -dead_strip -u _UIApplicationMain -u _xamarin_release_managed_ref -u _xamarin_create_managed_ref -u _xamarin_get_block_descriptor -u _xamarin_timezone_get_data -u _xamarin_log -u _mono_pmip
Process exited with code 1, command:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -framework UIKit -framework Foundation -framework CoreGraphics -weak_framework CFNetwork /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/libsmma_combo.a /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/libsmma.a /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonosgen-2.0.a /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libxamarin-debug.a /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/testface.exe.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/Xamarin.iOS.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/System.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/bind1.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/registrar.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/main.arm64.o -force_load /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libapp.a -licucore -lstdc++.6.0.9 -lgcc_eh -Wl,-pie -arch arm64 -miphoneos-version-min=9.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -lz -o /Users/bam/Projects/bind1/testface/bin/iPhone/Debug/testface.app/testface -liconv -lstdc++ -dead_strip -u _UIApplicationMain -u _xamarin_release_managed_ref -u _xamarin_create_managed_ref -u _xamarin_get_block_descriptor -u _xamarin_timezone_get_data -u _xamarin_log -u _mono_pmip
ld: library not found for -lgcc_eh
clang: error: linker command failed with exit code 1 (use -v to see invocation)
MTOUCH: error MT5209: Native linking error: library not found for -lgcc_eh
MTOUCH: error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -lstdc++ -dead_strip
MTOUCH: error MT5202: Native linking failed. Please review the build log.
Task "MTouch" execution -- FAILED
Done building target "_CompileToNative" in project "/Users/bam/Projects/bind1/testface/testface.csproj".-- FAILED
Done building project "/Users/bam/Projects/bind1/testface/testface.csproj".-- FAILED
Build FAILED.
没有太多数据可以帮助,但我可以说,
-lgcc_eh
不是直接从Xamarin.iOS来的
如果它不在您自己的项目选项中,那么它必须来自您在项目中使用的某个绑定/第三方程序集
您的部分构建日志提示有东西将libsmma\u combo.a
和libsmma.a
添加到您的项目中。它们也是其他选项(例如,-licucore-lstdc++.6.0.9
),可能来自您正在使用的第三方库的要求
有可能其中一个比较旧,并且有更新可用。没有太多数据可以帮助,但我可以说,
-lgcc_eh
并不是直接从Xamarin.iOS上下载的
如果它不在您自己的项目选项中,那么它必须来自您在项目中使用的某个绑定/第三方程序集
您的部分构建日志提示有东西将libsmma\u combo.a
和libsmma.a
添加到您的项目中。它们也是其他选项(例如,-licucore-lstdc++.6.0.9
),可能来自您正在使用的第三方库的要求
可能其中一个比较旧,并且有更新可用。谢谢Poupou,很抱歉我的解释不好。libsmma_combo.a和libsmma.a是我绑定的第三方应用程序。“-licucore-lstdc++.6.0.9”是我作为链接器标志添加到绑定库中的内容(我也尝试过没有链接器标志),如果需要,我可以提供更多信息。如果您的绑定在它的
[LinkWith]
属性中使用了needsGCExceptionHandling=true
,我们将非常感谢您的帮助。谢谢您,很抱歉我的错误解释。libsmma_combo.a和libsmma.a是我绑定的第三方应用程序。“-licucore-lstdc++.6.0.9”是我作为链接器标志添加到绑定库中的内容(我也尝试过没有链接器标志),如果需要,我可以提供更多信息。您的绑定是否在其[LinkWith]
属性中使用了needsAcceptionHandling=true
?
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -framework UIKit -framework Foundation -framework CoreGraphics -weak_framework CFNetwork /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/libsmma_combo.a /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/libsmma.a /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonosgen-2.0.a /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libxamarin-debug.a /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/testface.exe.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/Xamarin.iOS.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/System.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/bind1.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/registrar.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/main.arm64.o -force_load /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libapp.a -licucore -lstdc++.6.0.9 -lgcc_eh -Wl,-pie -arch arm64 -miphoneos-version-min=9.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -lz -o /Users/bam/Projects/bind1/testface/bin/iPhone/Debug/testface.app/testface -liconv -lstdc++ -dead_strip -u _UIApplicationMain -u _xamarin_release_managed_ref -u _xamarin_create_managed_ref -u _xamarin_get_block_descriptor -u _xamarin_timezone_get_data -u _xamarin_log -u _mono_pmip
Process exited with code 1, command:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -framework UIKit -framework Foundation -framework CoreGraphics -weak_framework CFNetwork /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/libsmma_combo.a /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/libsmma.a /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonosgen-2.0.a /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libxamarin-debug.a /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/testface.exe.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/Xamarin.iOS.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/System.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/bind1.dll.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/registrar.arm64.o /Users/bam/Projects/bind1/testface/obj/iPhone/Debug/mtouch-cache/main.arm64.o -force_load /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.2.22/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libapp.a -licucore -lstdc++.6.0.9 -lgcc_eh -Wl,-pie -arch arm64 -miphoneos-version-min=9.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -lz -o /Users/bam/Projects/bind1/testface/bin/iPhone/Debug/testface.app/testface -liconv -lstdc++ -dead_strip -u _UIApplicationMain -u _xamarin_release_managed_ref -u _xamarin_create_managed_ref -u _xamarin_get_block_descriptor -u _xamarin_timezone_get_data -u _xamarin_log -u _mono_pmip
ld: library not found for -lgcc_eh
clang: error: linker command failed with exit code 1 (use -v to see invocation)
MTOUCH: error MT5209: Native linking error: library not found for -lgcc_eh
MTOUCH: error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -lstdc++ -dead_strip
MTOUCH: error MT5202: Native linking failed. Please review the build log.
Task "MTouch" execution -- FAILED
Done building target "_CompileToNative" in project "/Users/bam/Projects/bind1/testface/testface.csproj".-- FAILED
Done building project "/Users/bam/Projects/bind1/testface/testface.csproj".-- FAILED
Build FAILED.