Bug 49220 - MTOUCH: error MT5209: Native linking error: file not found: -lsqlite3
Summary: MTOUCH: error MT5209: Native linking error: file not found: -lsqlite3
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: XI 10.4 (C9)
Hardware: Macintosh Mac OS
: --- major
Target Milestone: (C9)
Assignee: Rolf Bjarne Kvinge [MSFT]
Depends on:
Reported: 2016-12-07 13:45 UTC by Alain
Modified: 2017-01-02 11:57 UTC (History)
5 users (show)

Is this bug a regression?: Yes
Last known good build: C8

Response (1.20 MB, text/rtf)
2016-12-08 08:44 UTC, Alain

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:

Description Alain 2016-12-07 13:45:02 UTC

I compile my project with the ALPHA version of Xamarin.IOS 10.4 and I have the following message.

I do not understand why ?

With the stable version and BETA, no problem at compilation


/Users/MacROGISTER/Projects/MedinectIOSMACOS/MedinectIOS/MedinectIOS.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_CompileToNative target) ->

	MTOUCH:  warning MT5215: References to 'kernel32' might require additional -framework=XXX or -lXXX instructions to the native linker
	MTOUCH:  warning MT5215: References to 'kernel32' might require additional -framework=XXX or -lXXX instructions to the native linker


/Users/MacROGISTER/Projects/MedinectIOSMACOS/MedinectIOS/MedinectIOS.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_CompileToNative target) ->

	MTOUCH: error MT5209: Native linking error: file not found: -lsqlite3
	MTOUCH: error MT5202: Native linking failed. Please review the build log.

	 57 Warning(s)
	 2 Error(s)

Time Elapsed 00:00:06.9777010
Comment 1 Alex Soto [MSFT] 2016-12-08 06:59:02 UTC
Hello Alain, could you provide us the exact version that you are using?

The easiest way to get exact version information is to use the 
"Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" 
button and copy/paste the version informations (you can use the 
"Copy Information" button).
Comment 2 Alex Soto [MSFT] 2016-12-08 07:03:22 UTC
Also please include your full build logs with high verbosity enabled by adding -v -v -v -v to your additional mtouch arguments in your project build settings.
Comment 3 Alain 2016-12-08 08:44:36 UTC
Created attachment 18819 [details]

=== Visual Studio for Mac Preview ===

Version Preview 2 (7.0 build 560)
Installation UUID: 33ce5dd8-aa23-4f2b-a40a-5eb2235cff8d
	Mono 4.8.0 (mono-4.8.0-branch/5e1b0a0) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 408000374

=== NuGet ===

Version :

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.1 (11544)
Build 8B62

=== Xamarin.iOS ===

Version: (Visual Studio Enterprise)
Hash: d93ae7e
Branch: master
Build date: 2016-12-01 11:06:35-0500

=== Xamarin.Android ===

Version: (Visual Studio Enterprise)
Android SDK: /Users/MacROGISTER/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		6.0   (API level 23)

SDK Tools Version: 25.1.2
SDK Platform Tools Version: 24.0.0
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:

=== Xamarin.Mac ===

Version: (Visual Studio Enterprise)

=== Build Information ===

Release ID: 700000560
Git revision: 21714a71933f78242fea5b184a64f78bd5b11560
Build date: 2016-12-05 11:02:52-05
Xamarin addins: 6ef9b840f7003f55bc17782a901086305e96d290
Build lane: monodevelop-vNext-preview

=== Operating System ===

Mac OS X 10.12.1
Darwin imac-de-alain.appl-lan.be 16.1.0 Darwin Kernel Version 16.1.0
    Thu Oct 13 21:26:57 PDT 2016
    root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64
Comment 4 Rolf Bjarne Kvinge [MSFT] 2016-12-08 11:40:37 UTC
I think I know what's happening here, we end up passing this to the native linker:

    -force_load -lsqlite3

which is wrong (-force_load should not be passed).
Comment 5 Alain 2016-12-08 11:45:38 UTC
Ok, and I do what for it to work.

I have to wait for a correction on your part?
Comment 6 Rolf Bjarne Kvinge [MSFT] 2016-12-08 11:47:19 UTC
@Alain, we have to fix it; in the meantime you can downgrade to the current stable version.
Comment 7 Alain 2016-12-08 11:49:30 UTC
OK, I know that! As I said, it works with BETA and stable.

So to use the ALPHA, I have to wait for a correction?
Comment 8 Rolf Bjarne Kvinge [MSFT] 2016-12-08 11:54:56 UTC
Correct, to use the alpha you have to wait until we fix it.
Comment 9 Alain 2016-12-08 11:58:06 UTC
OK, thanks
Comment 10 Rolf Bjarne Kvinge [MSFT] 2016-12-08 12:28:15 UTC
PR: https://github.com/xamarin/xamarin-macios/pull/1313
Comment 12 Saurabh 2016-12-27 07:11:33 UTC
I am unable to reproduce this Issue with XI my template getiing deployed and launched successfully on simulator and devices in both configuration release and debug.

@Rolf, Could you please provide me some steps so that I can reproduce and verify it at my end?
Comment 13 Rolf Bjarne Kvinge [MSFT] 2017-01-02 07:36:19 UTC
@Saurabh, you should be able to reproduce this using the test code from the fix: https://github.com/xamarin/xamarin-macios/commit/8de0d43799b8b9d89c13add5ee1c57a9725843a2#diff-80c0ede08d66e5466ded7c0db6e978bfR2181
Comment 14 Alain 2017-01-02 08:24:47 UTC
with the new ALPHA version, I don't have this problem.

Comment 15 Mohit Kheterpal 2017-01-02 11:57:18 UTC
Thanks Alain for verifying this issue.

As per comment 14, this issue has been fixed for Alain.

Hence, closing this issue by marking it as Verified.