Bug 56331 - /Users/bert/Projects/Admove/Admove2IOS/MTOUCH: Error MT5216: Native linking failed for '/Users/bert/Projects/Admove/Admove2IOS/obj/iPhone/Debug/mtouch-cache/arm64/libInfinitePeripherals.Sdk.iOS.dll.dylib'.
Summary: /Users/bert/Projects/Admove/Admove2IOS/MTOUCH: Error MT5216: Native linking f...
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-05-13 08:07 UTC by Bert Degenhart Drenth
Modified: 2017-11-08 14:12 UTC (History)
6 users (show)

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


Attachments
Build log (180.71 KB, text/plain)
2017-05-13 08:07 UTC, Bert Degenhart Drenth
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 Bert Degenhart Drenth 2017-05-13 08:07:29 UTC
Created attachment 22155 [details]
Build log

In our product Axiell move we use a native library to control a Linea Pro barcode and RFID scanner.
With mono 5.0 the compilation suddenly ends with a compiler error 1
With mono 4.8 suddenly get the above problem.

Just to be sure that the problem is not in the native library itself we downloaded the latest version from the Infinea web site (the manufacturer of the scanner and linked that version in the software. The problem remained. 
The original compiler error problem was filed with Microsoft under case number 117051115721542
Microsoft recommended to revert back to the 4.8 version of the Mono framework. 

Not being able to link means that we are stuck and cannot submit an update to the app store.
Comment 1 Bert Degenhart Drenth 2017-05-22 11:13:15 UTC
There is a workaround for the mono 5.0 problem:

<PropertyGroup>
  <CscToolExe>mcs.exe</CscToolExe>
</PropertyGroup>

Placing this in the project definition forces Visual Studio to use the mcs compiler instead of csc.exe. After doing this we get exactly the same error as with the 4.8 framework. 

So still stuck ..
Comment 2 Rolf Bjarne Kvinge [MSFT] 2017-08-29 06:45:18 UTC
There seems to be a bug where the third-party binding library InfinitePeripherals.Sdk.iOS.dll does not correctly state that the corresponding native library requires CoreGraphics.

Possible fixes:

* Fix the third-party binding library (or request a fix from the vendor). The library has a [LinkWith] attribute that must contain the required frameworks: [assembly: LinkWith ("libdtdev.a", Frameworks = "CoreGraphics", ...)]
* Add '--framework CoreGraphics' to the additional mtouch arguments in the project's iOS Build options.
* Add '--gcc_flags "-framework CoreGraphcis"' to the additional mtouch arguments in the project's iOS Build options.
* Disable incremental builds in the project's iOS Build options.
Comment 3 Bert Degenhart Drenth 2017-11-08 14:12:29 UTC
switching off incremental builds was for me the easiest way to overcome the problem. I will check the vendors support pages for an update later.
But thanks Rolf for this solution.