开发者

No longer able to link embedded MonoTouch iPhone app

I am attempting to embed a Mono library and MonoTouch into an iPhone application. I had everything working and then something happened on my machine (MonoTouch update?) and now I am unable to link the application when targeting the device. Everything builds fine for the simulator, but I get over a thousand warnings and some errors when targeting the device. The Mono libraries that it is trying to link against are the wrong architecture.

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 /De开发者_开发技巧veloper/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

My guess is that it has something to do with MonoTouch not being activated. I've tried re-installing MonoTouch and re-activating MonoTouch. Neither had any affect on errors.

Other Linker Flags

-ObjC -L/Developer/MonoTouch/SDKs/MonoTouch.$(PLATFORM_NAME).sdk/usr/lib -lmono -lmonotouch -all_load

Mono Version

$ 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 Version

$ /Developer/MonoTouch/usr/bin/mtouch --version
mtouch 3.2.6.9797

I can take this same project and build it on another machine and it builds as expected. Any help in tracking this down is much appreciated.


The 4.3 SDK does not allow linking an armv6 library into an armv7 app. Either change your application to target armv6 only, or upgrade to MonoTouch 4.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜