I upgraded our environment to Xcode 4.2/iOS5 (for our C++ libraries) and 
MonoTouch 5.0 (for C# code). After switching, we had trouble getting our C#/C++ 
combo app to run:
1) The MonoTouch side of our app was producing exceptions when trying to 
P/Invoke into our C++ code because it couldn't find the C++ library entry 
points. Xcode now targets armv7 by default and no longer puts in an armv6 
option in the Architectures entry in the project's build settings. After 
manualling adding armv6, our MonoTouch code found the C++ entry points.
2) We had been using the GCC 4.2 compiler in Xcode but that is no longer an 
option in Xcode 4.2. The default Apple compiler is now Apple LLVM Compiler. 
After looking into a couple of bizarre bugs introduced by the Xcode 4.1->4.2 
upgrade, I tracked them down to what appears to be a bug in the Apple LLVM 
Compiler where it has trouble with the alignment of uInt16 members of C++ 
structures/classes. The bug only exists when this compiler is generating armv6 
code; the C++ code worked fine when compiled for armv7. I switched the compiler 
to LLVM GCC 4.2 (armv6) and now everything is working again.

It appears that Apple is leaning towards/favouring armv7 because their 
armv6-based products are getting older. Is MonoTouch going to fully support 
armv7 (see bug 952) any time soon? If MonoTouch had supported armv7, the 
transition to Xcode 4.2 would have gone much smoother for us.

Regards,
Conway

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Robert Jordan
Sent: October 25, 2011 2:02 PM
To: [email protected]
Subject: Re: [MonoTouch] xcode 4.2 and external libraries

Hi,

Mono's LLVM backend is entirely independent from Apple's compiler.
You don't need to enable Mono's LLVM to be able to link native
libraries created with Apple's compiler, and vice versa.

Robert

On 25.10.2011 20:36, Shawn Baker wrote:
> After installing Xcode 4.2, I noticed that it only supports two C/C++
> compilers, "Apple LLVM compiler 3.0" and "LLVM GCC 4.2". As far as I can
> tell, plain old "GCC 4.2" is no longer available. Our product uses several
> C/C++/Obj-C libraries that are built with Xcode, all linked into a large UI
> written in C#. It seems to me that the only way this is going to work is if
> I configure my C# project with "Use LLVM optimizing compiler". But if I do
> that, I can't use the debugger. Furthermore, decades of programming
> experience have left me extremely hesitant to trust anything marked as
> experimental.
>
> So, am I missing something? Is there a way to do this and still have
> debugging? Is MT's LLVM support "really" experimental and/or is that going
> to change any time soon?
>
> I'm really not sure where to go from here, so I'm still working with Xcode
> 4.1 for now.
>
>
> --
> View this message in context: 
> http://monotouch.2284126.n4.nabble.com/xcode-4-2-and-external-libraries-tp3937760p3937760.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
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to