Bug 35358 - Native linking fails for arm64 when switching from iOS target 6.0 to 7.0
Summary: Native linking fails for arm64 when switching from iOS target 6.0 to 7.0
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 9.0 (iOS9)
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-10-29 11:40 UTC by John Miller [MSFT]
Modified: 2015-10-30 12:02 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Build output of Xamarin.iOS project targeting deployment target 7.0 (777.36 KB, text/plain)
2015-10-30 04:40 UTC, Geir Smestad
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description John Miller [MSFT] 2015-10-29 11:40:30 UTC
**Overview:**

   When this project is changed from targeting iOS 6.0 to iOS 7.0, building fails due to native linking errors. 

**Actual Results:**

   See attached build outputs to compare. 
   The 6.0 build succeeds. 
   The 7.0 build fails. 

**Expected Results:**

   Both should succeed. 

**Build Date & Platform:**

=== Xamarin Studio ===

Version 5.9.7 (build 22)
Installation UUID: d2e93cfb-f8d3-4457-83bd-27a826d241e7
Runtime:
	Mono 4.0.4 ((detached/d481017)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040004

=== Apple Developer Tools ===

Xcode 7.0 (8227)
Build 7A220

=== Xamarin.iOS ===

Version: 9.0.1.29 (Enterprise Edition)
Hash: 1d27ac2
Branch: master
Build date: 2015-09-25 18:08:44-0400

=== Xamarin.Android ===

Version: 5.1.8.0
Android SDK: Not found

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Not Installed

=== Build Information ===

Release ID: 509070022
Git revision: 6bd1f169df44ca96addf8a035316c535a4fa46fa
Build date: 2015-09-30 12:30:15-04
Xamarin addins: 1c3e5c0859bdfec0ecd481a57ad6c03bc22f5536

=== Operating System ===

Mac OS X 10.10.5
Comment 3 Rolf Bjarne Kvinge [MSFT] 2015-10-29 12:27:48 UTC
Apple changed the C++ library in iOS 7, which is probably what's causing this.

One possible fix would be to build with "-lstdc++" instead of "-lc++".

In any case the errors come from a third party library (DSAPP_Client), and you should contact them to see which linker flags their library require.
Comment 4 Geir Smestad 2015-10-30 04:40:59 UTC
Created attachment 13582 [details]
Build output of Xamarin.iOS project targeting deployment target 7.0

Additional mtouch arguments: --gcc_flags "-lstdc++" -v -v -v -v
Comment 5 Geir Smestad 2015-10-30 04:43:29 UTC
Thanks for the info, that's good to know. I've tried building the project with '--gcc_flags "-lstdc++" -v -v -v -v' under 'Additional mtouch arguments and I still get similar errors; build output attached.

I'll get in touch with our third-party vendor. It is sufficient to put the linker flags required for building their library under additional mtouch arguments, correct? There is a binding project involved also.
Comment 6 Rolf Bjarne Kvinge [MSFT] 2015-10-30 12:02:20 UTC
@Geir, it looks like your binding project adds the "-lc++" compiler flag (in a LinkWith attribute), try removing that and see what happens.

It is sufficient to put the linker flags as an additional mtouch argument, but it's usually easier to change it in the binding project (the additional mtouch arguments are per project configuration, which means you'll have to remember to change it in every project configuration, but if you change the LinkWith attribute in the binding project you only change it once).