Thanks, that helped a lot. I had two separate issues both resolved by the "-v -v -v" in the additional mtouch arguments of step 3.
1. My output static lib from step #1 was built for the armv7 arch, but I was trying to run #3 on the simulator which is i386. Therefore, the verbose mtouch told me it was ignoring my static lib during linking because the architecture didn't match. I switched to testing on the real device to resolve this problem.
2. The link failed stating I had duplicate main symbols. This was because I added a main.m in my static library from #1 so that I could test it from the ObjC side. This duplicates the main method of the ios app from #3. Therefore, I simply removed my main.m from the static lib and recompiled 1, 2, and 3. Presto, it works great!
-------- Original Message --------
Subject: Re: [MonoTouch] Btouch bindings help
From: Rolf Bjarne Kvinge <[email protected]>
Date: Mon, May 21, 2012 7:20 am
To: spcware <[email protected]>
Cc: [email protected]
Hi,On Sun, May 20, 2012 at 1:45 AM, spcware <[email protected]> wrote:I am trying to play around with making bindings for an objc lib. I am first
trying with a very simple static .a that I made. Here is what i have done so
far:
1. Start Xcode, choose static lib project, make a class called BTouchTest
that contains 2 instance variables that are ints called op1 and op2, added a
setter for op1 and a setter for op2, added a getSum method to return the sum
of the two operands, built the libBTouchTest.a lib successfully
2. Start monodevelop, choose binding library project, added my static .a to
the project and md generated my LinkWith statement, created the bindings
using basetype of NSObject, created each of the three methods with correct
export attributes, built the dll which supposedly includes the static
library inside
3. Switch to new MD project for iPad, added reference to my new dll,
constructed a new BTOuchTest obj, set the two operands, displayed the result
of getSum in an alert view, I always get 0
How do I troubleshoot this? Everything has built successfully in all 3
stages, everything, I think, is using armv7. How can I tell if my
underlying static library is even being called?Call printf/NSLog in your objc methods/setters/getters and see if it's printed.Also enable verbose build output for 3) (adding "-v -v -v" to the additional mtouch arguments in the project properties), and check the output for any (native) linker errors/warnings.Rolf
--
View this message in context: http://monotouch.2284126.n4.nabble.com/Btouch-bindings-help-tp4646420.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
