Bug 34866 - MT5210 Unable to create binding project for the NanoCosmos iOS SDK
Summary: MT5210 Unable to create binding project for the NanoCosmos iOS SDK
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-14 11:49 UTC by John Miller [MSFT]
Modified: 2015-10-29 16:58 UTC (History)
3 users (show)

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


Attachments
Binding and Sample (4.09 MB, application/zip)
2015-10-14 11:49 UTC, John Miller [MSFT]
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-14 11:49:35 UTC
Created attachment 13328 [details]
Binding and Sample

**Overview:**

   The attached binding/sample does not build. I am unable to get this binding to build. There are 49 errors like this:

Error MT5210: Native linking failed, undefined symbol: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (nanocosmos.ios)

The project already has linker flags for -lstdc++ and lc++ per the docs here: https://www.nanocosmos.de/v4/documentation/nanostream_sdk_for_ios_-_developer_documentation

**Steps to Reproduce:**

   1. Try and build the iOS app in the attached project. 

**Actual Results:**

   49 errors related to Native Linking failing.

**Expected Results:**

   No errors. 

**Build Date & Platform:**

   XI 9.0.1.29
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-10-14 12:10:53 UTC
Using this in the LinkWith attribute works (the exact version number might depend on the version of Xcode used to build the app):

> LinkerFlags = "-lstdc++.6.0.9 -lc++"
Comment 2 filip 2015-10-14 15:26:37 UTC
Hi Rolf,
I am glad this got to you as it continues from the forum.
(https://forums.xamarin.com/discussion/16619/native-linking-failed-undefined-symbol)
I have downloaded the Binding sample and added what you suggested and the build passed with no problem. But when I added the project or the dll that was created into my project I got the same error. I even setup the project (options->ios build) to match the one in this post, and no luck. I am sure something in my project is the root cause but I cannot  see  what could be.
I am posting the building results, without the 47 errors as you can see them from this project, in hope you have a little bit more patience to assist on this:
Tool /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch execution started with arguments: --cache /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache --dev /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/bin/iPhone/Debug/RSA.app --executable RSA --fastdev --debug --profiling --linksdkonly --sdkroot /Applications/Xcode.app/Contents/Developer --sdk 9.0 --targetver 7.0 --new-refcount --abi=armv7,arm64 --symbollist /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-symbols.list --dsym=no --gcc_flags=-stdlib=libstdc++ -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.dll -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Xml.dll -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Mono.CSharp.dll -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Net.Http.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/packages/Newtonsoft.Json.7.0.1/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/Documents/libraries/TestFairy.iOS.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/Components/restsharp-105.0.1.0/lib/ios-unified/RestSharp.MonoTouch.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/Components/sdwebimage-3.7.1.4/lib/ios-unified/SDWebImage.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/Components/notificare-1.5.4/lib/ios-unified/Notificare.iOS-Unified.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/Documents/SharpMobileCode.ModalPicker.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/Components/nativecss-1.1.3/lib/ios-unified/NativeCSS.iOS.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/Documents/libraries/test/nanocosmos.dll -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Core.dll -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/mscorlib.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/packages/Newtonsoft.Json.7.0.1/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/Documents/libraries/TestFairy.iOS.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/Components/restsharp-105.0.1.0/lib/ios-unified/RestSharp.MonoTouch.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/Components/sdwebimage-3.7.1.4/lib/ios-unified/SDWebImage.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/Components/notificare-1.5.4/lib/ios-unified/Notificare.iOS-Unified.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/Documents/SharpMobileCode.ModalPicker.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/Components/nativecss-1.1.3/lib/ios-unified/NativeCSS.iOS.dll -r /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/Documents/libraries/test/nanocosmos.dll --target-framework Xamarin.iOS,v1.0 /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/bin/iPhone/Debug//RSA.exe 
		Xamarin.iOS 9.0.1 Business Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk
		Process exited with code 1, command:
		/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++  -licucore -lstdc++.6.0.9 -lc++ -ObjC -fobjc-arc -Wl,-pie  -arch arm64 -miphoneos-version-min=7.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/registrar.arm64.o /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/main.arm64.o /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/RSA.exe.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/Xamarin.iOS.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/System.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/System.Xml.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/System.Core.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/Mono.Dynamic.Interpreter.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/Notificare.iOS-Unified.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/nanocosmos.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/SharpMobileCode.ModalPicker.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/TestFairy.iOS.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/NativeCSS.iOS.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/Newtonsoft.Json.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/System.Runtime.Serialization.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/System.Net.Http.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/RestSharp.MonoTouch.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/System.Xml.Linq.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/SDWebImage.dll.arm64.dylib /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/libnanostreamAVC.a /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/libSDWebImage.a -force_load /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/NotificarePushLib.a -force_load /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/libTestFairy.a -force_load /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/libnativeCSS.a -o /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/64/Output/RSA -framework AVFoundation -framework CoreGraphics -framework AudioToolbox -framework QuartzCore -framework CoreLocation -framework Foundation -framework MapKit -framework Security -framework SystemConfiguration -framework CoreMotion -framework UIKit -framework StoreKit -framework CFNetwork -framework Foundation, -framework UIKit, -framework CoreLocation, -framework MessageUI, -framework CoreGraphics, -framework PassKit, -framework MapKit, -framework SystemConfiguration, -framework Security, -framework CFNetwork, -framework MobileCoreServices, -framework ImageIO, -framework CoreVideo -framework CoreMedia -framework Accelerate -framework OpenGLES -framework MessageUI -framework VideoToolbox -framework CoreText -framework CoreImage -framework ImageIO -lz -liconv -u _mono_pmip -u _TFSessionDidStartNotification -u _TFSessionNotificationUrlKey -u _SDWebImageDownloadStartNotification -u _SDWebImageDownloadStopNotification -u _CreateZStream -u _CloseZStream -u _Flush -u _ReadZStream -u _WriteZStream -u _monotouch_start_wwan -u _xamarin_release_managed_ref -u _xamarin_create_managed_ref -u _xamarin_get_block_descriptor -u _monotouch_GetFolderPath -u _monotouch_log -u _monotouch_timezone_get_data /Users/fmatosic/xamarin/workspaces/RSAAVOK/RSAOKFILIP/RSA/RSA/obj/iPhone/Debug/mtouch-cache/64/Output/libmonosgen-2.0.dylib /Library/Frameworks/Xamarin.iOS.framework/Versions/9.0.1.29/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonotouch-sgen-debug.a /Library/Frameworks/Xamarin.iOS.framework/Versions/9.0.1.29/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libapp.a /Library/Frameworks/Xamarin.iOS.framework/Versions/9.0.1.29/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmono-profiler-log.dylib -stdlib=libstdc++
Comment 3 filip 2015-10-14 16:58:27 UTC
What I see here is the -ObjC flag but I am not using it anywhere in the setup of my project.
Comment 4 Rolf Bjarne Kvinge [MSFT] 2015-10-15 03:54:54 UTC
@filip, can you zip up and attach your complete solution that fails to build?
Comment 5 filip 2015-10-15 06:25:40 UTC
Rolf, I belive that some  added library could be adding the ObjC flag so i will do some tests on the project you sent me by adding the libraries one by one to determine if this is the case.
Comment 6 filip 2015-10-29 16:29:45 UTC
Rolf,
after updating xamarin your solution is not building:

/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/nanocosmos.csproj (Build) ->
/Library/Frameworks/Mono.framework/Versions/4.0.5/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) ->

	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/nanostreamLogLevel.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `nanostreamLogLevel'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/nanostreamEvent.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `nanostreamEvent'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/nanostreamCropMode.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `nanostreamCropMode'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/nanoStreamH264ProfileLevel.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `nanoStreamH264ProfileLevel'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/nanoStreamAudioChannel.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `nanoStreamAudioChannel'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/nanoStreamResolution.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `nanoStreamResolution'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/NSXStreamType.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `NSXStreamType'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/NSXEncodingMode.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `NSXEncodingMode'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/AdaptiveBitrateControlMode.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `AdaptiveBitrateControlMode'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/nanoStreamLocalRecordingMode.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `nanoStreamLocalRecordingMode'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/AVCOverlayBufferType.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `AVCOverlayBufferType'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/NSXVideoSource.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `NSXVideoSource'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/NSXRunStatusError.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `NSXRunStatusError'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/NSXRtmpSourceError.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `NSXRtmpSourceError'
	/Users/fmatosic/Downloads/nanocosmos 2 2/nanocosmos/obj/Debug/ios/nanocosmos/NSXRtmpSourceStopReason.g.cs(38,14): error CS0101: The namespace `nanocosmos' already contains a definition for `NSXRtmpSourceStopReason'

	 0 Warning(s)
	 15 Error(s)

my xamarin details:
=== Xamarin Studio ===

Version 5.9.8 (build 0)
Installation UUID: 55a917f4-bf6d-48d7-9271-6df7d5922e11
Runtime:
	Mono 4.0.5 ((detached/1d8d582)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400050001

=== Xamarin.Android ===

Not Installed

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 7.1 (9079)
Build 7B91b

=== Xamarin.iOS ===

Version: 9.1.0.18 (Business Edition)
Hash: 7426bd7
Branch: master
Build date: 2015-10-21 22:54:37-0400

=== Xamarin.Mac ===

Not Installed

=== Build Information ===

Release ID: 509080000
Git revision: cc5f6e5658589ca7f46210c57fad947e75f30abd
Build date: 2015-10-21 19:27:41-04
Xamarin addins: d77f191bd7d3451adf837b85b38f2b7c60004400

=== Operating System ===

Mac OS X 10.11.1
Darwin filips-iMac.fritz.box 15.0.0 Darwin Kernel Version 15.0.0
    Sat Sep 19 15:53:46 PDT 2015
    root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64
Comment 7 Rolf Bjarne Kvinge [MSFT] 2015-10-29 16:32:07 UTC
@filip, that was fixed in the stable release we did yesterday (https://developer.xamarin.com/releases/ios/xamarin.ios_9/xamarin.ios_9.1/#1).
Comment 8 filip 2015-10-29 16:58:22 UTC
After Restarting Xamarin works OK