Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
962 views
in Technique[技术] by (71.8m points)

iphone - Monotouch binding for TouchJSON?

The admob sdk for iPhone uses a proprietary libAdMobNoThumb.a library and an Objective-C source based TouchJSON library.

Does anybody know of a C# binding for TouchJSON so that we can include it?

Or does anybody know how to build a library that can be included?

We created an iPhone Library project with Xcode and added the full TouchJSON source tree. We've than linked the resulting libTouchJSON.a in a test iPhone app with following gcc_flags:

-v -v -v -gcc_flags "-L${ProjectDir}/Lib -lAdMobNoThumb -lTouchJSON -force_load ${ProjectDir}/Lib/libAdMobNoThumb.a -force_load ${ProjectDir}/Lib/libTouchJSON.a"

This produced following error output (thanks to the -v -v -v):

Error 1: mtouch failed with the following message:
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m: In function 'monotouch_debug_connect':
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m:1779: warning: implicit declaration of function 'select'
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m: In function 'main':
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m:1821: warning: implicit declaration of function 'chdir'
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m:1838: warning: implicit declaration of function 'monotouch_enable_debug_tracking'
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m:1914: warning: implicit declaration of function 'dup2'
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m:1921: warning: implicit declaration of function 'mini_get_debug_options'
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m:1925: warning: implicit declaration of function 'mono_debugger_agent_parse_options'
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m:2052: warning: implicit declaration of function 'getpagesize'
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m:2055: warning: cast from pointer to integer of different size
/var/folders/hF/hF42FIdhEUmY1y-pGRsu1k+++TI/-Tmp-/tmpe374af5.tmp/main.m:2055: warning: initialization makes pointer from integer without a cast
Undefined symbols:
  "_OBJC_CLASS_$_CJSONSerializer", referenced from:
      objc-class-ref-to-CJSONSerializer in libAdMobNoThumb.a(AdMobAd.o)
      objc-class-ref-to-CJSONSerializer in libAdMobNoThumb.a(AdMobWebView.o)
      objc-class-ref-to-CJSONSerializer in libAdMobNoThumb.a(AdMobFlexWebView.o)
  "_OBJC_CLASS_$_CJSONDeserializer", referenced from:
      objc-class-ref-to-CJSONDeserializer in libAdMobNoThumb.a(AdMobOpener.o)
      objc-class-ref-to-CJSONDeserializer in libAdMobNoThumb.a(AdMobSearchViewController.o)
      objc-class-ref-to-CJSONDeserializer in libAdMobNoThumb.a(AdMobAd.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
 (1) (AdMobber)

Any suggestions to get around this problem?

TIA, Mollyke.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your AdMob library cannot find the CJSONDeserializer or CJSONSerializer classes, which I presume come from libTouchJSON.a. Generally this means that your libTouchJSON.a wasn't included in your project. You should double check all your extra arguments, and ensure that your libTouchJSON is not thumb and includes all the architectures you're trying to link (x86 for simulator, armv6 for device)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...