1
我試圖將Mono庫和MonoTouch嵌入到iPhone應用程序中。我有一切工作,然後在我的機器上發生了一些事情(MonoTouch更新?),現在我無法在定位設備時鏈接應用程序。對於模擬器來說,一切都很好,但是在瞄準設備時,我得到了一千多條警告和一些錯誤。它試圖鏈接的Mono庫是錯誤的架構。不再能夠鏈接嵌入式MonoTouch iPhone應用程序
ld: warning: ARM function mono_aot_version not 4-byte aligned
ld: warning: ARM function mono_aot_full_aot not 4-byte aligned
ld: warning: ARM function mono_runtime_version not 4-byte aligned
ld: warning: ARM function mono_aot_assembly_name not 4-byte aligned
ld: warning: ARM function name_0 not 4-byte aligned
ld: warning: ARM function name_1 not 4-byte aligned
ld: warning: ARM function name_2 not 4-byte aligned
...
... lots of these warnings
...
ld: warning: ARM function name_53 not 4-byte aligned
ld: warning: ARM function name_54 not 4-byte aligned
ld: warning: ARM function name_55 not 4-byte aligned
ld: warning: ARM function name_56 not 4-byte aligned
ld: warning: ignoring file /Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmono.a, file was built for archive which is not the architecture being linked (armv7)
ld: warning: ignoring file /Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonotouch.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
"_monotouch_setup_classmap", referenced from:
_monotouch_create_classes in registrar.o
"_mono_object_new", referenced from:
-[CalcEvaluator init] in CalcEvaluator.o
"_mono_aot_register_module", referenced from:
-[CalcEvaluator init] in CalcEvaluator.o
"_mono_jit_init", referenced from:
-[CalcEvaluator init] in CalcEvaluator.o
"_mono_runtime_object_init", referenced from:
-[CalcEvaluator init] in CalcEvaluator.o
"_mono_assembly_get_image", referenced from:
-[CalcEvaluator init] in CalcEvaluator.o
"_mono_assembly_open", referenced from:
-[CalcEvaluator init] in CalcEvaluator.o
"_mono_jit_set_aot_only", referenced from:
-[CalcEvaluator init] in CalcEvaluator.o
"_mono_class_from_name", referenced from:
-[CalcEvaluator init] in CalcEvaluator.o
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status
我的猜測是它與MonoTouch沒有被激活有關。我試過重新安裝MonoTouch並重新激活MonoTouch。對錯誤也沒有任何影響。
其它鏈接器標記
-ObjC -L/Developer/MonoTouch/SDKs/MonoTouch.$(PLATFORM_NAME).sdk/usr/lib -lmono -lmonotouch -all_load
單聲道版本
$ mono -V
Mono JIT compiler version 2.6.7 (tarball Tue Aug 24 16:33:27 MDT 2010)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
TLS: normal
GC: Included Boehm (with typed GC)
SIGSEGV: normal
Notification: Thread + polling
Architecture: x86
Disabled: none
MonoTouch的版本
$ /Developer/MonoTouch/usr/bin/mtouch --version
mtouch 3.2.6.9797
我可以採用這個相同的項目,並在另一臺機器上構建它,並按預期構建它。任何幫助跟蹤這一點非常感謝。
如果我從Architectures設置中刪除armv7,我沒有收到錯誤信息,但仍收到「不是4字節對齊」警告。任何想法是什麼導致警告? – BLeB 2011-03-23 14:49:13
它是一種警告,是由於我們如何在monotouch 3中發射它的組件而造成的,它是無害的。如果你不想看到它升級到monotouch 4. – 2011-03-23 17:44:20
我已經升級到monotouch 4.它現在生成額外的* .6.s文件。我猜這些是爲了armv6?我對這些做什麼?只有在定位設備時,我仍然會收到警告。 – BLeB 2011-03-23 18:57:37