Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
I'm trying to compile binding library for ShareKit library, simulator version works fine, but compilation for device fails with linker error. Demo application built from XCode also works.
Steps to reproduce: build test solution from attachment (native library project included)
Process exited with code 1, command:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -Wl,-no_pie -miphoneos-version-min=6.1 -gdwarf-2 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /var/folders/f5/t9d0pqgs10zfnmvbkr298zdr0000gn/T/tmp13b1812.tmp/TestShareKit.exe.armv7.o /var/folders/f5/t9d0pqgs10zfnmvbkr298zdr0000gn/T/tmp13b1812.tmp/ShareKit.dll.armv7.o /var/folders/f5/t9d0pqgs10zfnmvbkr298zdr0000gn/T/tmp13b1812.tmp/System.Core.dll.armv7.o /var/folders/f5/t9d0pqgs10zfnmvbkr298zdr0000gn/T/tmp13b1812.tmp/Mono.Security.dll.armv7.o /var/folders/f5/t9d0pqgs10zfnmvbkr298zdr0000gn/T/tmp13b1812.tmp/System.dll.armv7.o /var/folders/f5/t9d0pqgs10zfnmvbkr298zdr0000gn/T/tmp13b1812.tmp/monotouch.dll.armv7.o /var/folders/f5/t9d0pqgs10zfnmvbkr298zdr0000gn/T/tmp13b1812.tmp/mscorlib.dll.armv7.o /Users/alexander/projects/TestShareKit/TestShareKit/obj/Debug/mtouch-cache/main..armv7.cache.6quKWOf7CMdYW0KGSbNZ+C4vzd4=.o /Users/alexander/projects/TestShareKit/TestShareKit/obj/Debug/mtouch-cache/registrar.armv7.cache.Yc3JF9jgIt+8RLXsLvmb34EVPKU=.o -o /var/folders/f5/t9d0pqgs10zfnmvbkr298zdr0000gn/T/tmp13b1812.tmp/TestShareKit -framework CFNetwork -framework Foundation -framework UIKit -framework AudioToolbox -framework CoreGraphics -framework Social -framework Accounts -framework AdSupport -framework Twitter -framework CoreLocation -framework MessageUI -framework Security -framework SystemConfiguration -framework CoreFoundation -lz -liconv -u _mono_pmip -u _monotouch_create_managed_ref -u _monotouch_release_managed_ref -u _monotouch_IntPtr_objc_msgSend_IntPtr -u _monotouch_IntPtr_objc_msgSendSuper_IntPtr -u _CloseZStream -u _CreateZStream -u _Flush -u _ReadZStream -u _WriteZStream -lmono-2.0 -lmonotouch-debug -L/Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/lib -force_load /var/folders/f5/t9d0pqgs10zfnmvbkr298zdr0000gn/T/tmp13b1812.tmp/libShareKit.a -sqlite3.0 "-lsqlite3.0"
collect2: ld terminated with signal 6 [Abort trap: 6]
ld(18617,0x7fff7948e180) malloc: *** error for object 0x7fc5fbcbbdf0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
error MT5201: Native linking failed. Please review user flags provided to gcc: "-lsqlite3.0"
at MTouch.CompileToNative (System.String user_gcc_flags, System.Collections.Generic.List`1 assemblies, IList`1 inputs) [0x00000] in <filename unknown>:0
at MTouch.Main2 (System.String args) [0x00000] in <filename unknown>:0
at MTouch.Main (System.String args) [0x00000] in <filename unknown>:0
IDE and OS details:
Version 4.0 (build 2003)
Installation UUID: 5ab8a0d5-8e36-4b00-b445-d9c8f08cd214
Mono 2.10.11 (mono-2-10/2baeee2)
Package version: 210110000
Apple Developer Tools
Xcode 4.6 (2066)
Version: 18.104.22.168 (Business Edition)
Xamarin.Mac: Not Installed
Git revision: Release ID: 400002003
Build date: 2013-02-20 00:32:59+0000
Xamarin addins: b7a7aff09b352c13ded8a27439fd6d2250361511
Mac OS X 10.8.2
Darwin MacBook-Air-Alexander-Kuznetsov.local 12.2.0 Darwin Kernel Version 12.2.0
Sat Aug 25 00:48:52 PDT 2012
Attachment was too big - sample solution is here:
For some reason gcc is crashing when it tries to link for device and I don't know why.
Alexander: currently you are adding the -lsqlite3.0 in both the LinkWith attribute *and* in the "Additional mtouch arguments" in the Project Options. You don't need to do that. I would recommend removing the gcc flags from your Project Options.
Maybe Sebastien will have an idea why gcc is crashing...
Yes, this sqlite linking was the only suspicious point I saw so I just tried to add LinkerFlags parameter in hope that it would magically help (it didn't).
It seems, by the way, that LinkerFlags parameter in binding library doesn't make any difference at all - if I leave it and remove flags from main project, linker can't find sqilite lib symbols.
I modified your project locally to remove the -lsqlite3.0 from the Project Options and the build used the -lsqlite3.0 directly from the LinkerFlags property just fine.
(btw, that's why when you build it, it probably has 2 -lsqlite3.0's - one is from LinkerFlags and one is from Project Options... at least when I first tried building your project, it added -lsqlite3.0 twice)
You're right, a had a misprint in LinkerFlags.
We just found that workaround from this thread (setting Minimum iOS version to 5.1) is working:
but we can't rollback our whole project to 5.1 :(
We found solution that seems to work: just removed CoreFoundation from LinkWithAttribute.Frameworks property.
*** This bug has been marked as a duplicate of bug 6998 ***