[MonoTouch] Problem binding library

2014-01-02 Thread Matteo Polito
Hi guys, I've a problem on binding GameCircle library by Amazon. They offer
the Unity plugin for they library, I want to use classes they made for
Unity on Monotouch. I've extracted unity plugin and now I want to use it on
Monotouch. I've created a project and hosted it on GitHub (
https://github.com/mapo80/GameCircle.Monotouch).

There are two libraries: - AmazonInsightsSDK.a - GameCircle.a

I'm using this linkWith parameters: [assembly: LinkWith
(AmazonInsightsSDK.a, LinkTarget.ArmV7 | LinkTarget.ArmV7s |
LinkTarget.Simulator, ForceLoad = true, IsCxx = true,
LinkerFlags=-lsqlite3.0 -lstdc++, Frameworks = AdSupport GameKit
MessageUI CoreTelephony SystemConfiguration Security ExternalAccessory
Foundation)]

[assembly: LinkWith (GameCircle.a, LinkTarget.Simulator |
LinkTarget.ArmV7 | LinkTarget.ArmV7s, ForceLoad = true, IsCxx = true,
LinkerFlags=-lsqlite3.0 -lstdc++, Frameworks = AdSupport GameKit
MessageUI CoreTelephony SystemConfiguration Security ExternalAccessory
Foundation)]

When I reference dll on my iOS projects I obtain these errors:

Compiling to native code /Developer/MonoTouch/usr/bin/mtouch -sdkroot
/Applications/Xcode.app/Contents/Developer --cache
/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache
--nomanifest --nosign -sim
/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.app
-r
/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleBinding/bin/Debug/Monotouch.AmazonGameCircleBinding.dll
-r /Developer/MonoTouch/usr/lib/mono/2.1/System.dll -r
/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll -r
/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll -r
/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll -debug -nolink -sdk
7.0 -targetver 7.0 --abi=i386
/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.exe
Xamarin.iOS 7.0.6 Business Edition using framework:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk
Process exited with code 1, command:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-lsqlite3.0 -lstdc++ -Wl,-pie -gdwarf-2 -arch i386 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk
-Qunused-arguments -fobjc-legacy-dispatch -fobjc-abi-version=2
-mios-simulator-version-min=7.0
/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/main.i386.o
-force_load
/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/AmazonInsightsSDK.a
-force_load
/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/GameCircle.a
-o
/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.app/MonotouchAmazonGameCircleTestApp
-framework CFNetwork -framework AVFoundation -framework Accelerate
-framework AddressBook -framework AudioToolbox -framework QuartzCore
-framework CoreBluetooth -framework CoreData -framework CoreGraphics
-framework CoreImage -framework CoreLocation -framework CoreText -framework
Foundation -framework GameKit -framework ImageIO -framework
MobileCoreServices -framework Security -framework SystemConfiguration
-framework CoreMedia -framework CoreMIDI -framework CoreVideo -framework
StoreKit -framework AssetsLibrary -framework Accounts -framework
CoreTelephony -framework EventKit -framework EventKitUI -framework
CoreMotion -framework GLKit -framework iAd -framework MapKit -framework
MediaPlayer -framework MessageUI -framework NewsstandKit -framework
OpenGLES -framework Social -framework Twitter -framework UIKit -framework
PassKit -framework SpriteKit -framework JavaScriptCore -framework
MultipeerConnectivity -framework AddressBookUI -framework SafariServices
-framework ExternalAccessory -framework AdSupport -framework QuickLook -lz
-liconv -u _mono_pmip -u _xamarin_init_nsthread -u
_xamarin_get_block_descriptor -u _monotouch_get_locale_country_code -u
_monotouch_log -u _monotouch_start_wwan -u _monotouch_timezone_get_data -u
_monotouch_timezone_get_names -u _monotouch_IntPtr_objc_msgSend_IntPtr -u
_monotouch_IntPtr_objc_msgSendSuper_IntPtr -u
_monotouch_release_managed_ref -u _monotouch_create_managed_ref -u
_CloseZStream -u _CreateZStream -u _Flush -u _ReadZStream -u _WriteZStream
/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmonoboehm-2.0.a
/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmonotouch-debug.a
duplicate symbol _MD5 in:

Re: [MonoTouch] Problem binding library

2014-01-02 Thread Jeff Stedfast
It would appear that there are 2 public MD5 structs or methods in those
native libraries and the linker doesn't know which one to use. I'm not sure
how to solve that... do you have the source code for these native libraries?


On Thu, Jan 2, 2014 at 4:44 PM, Matteo Polito map...@gmail.com wrote:

 Hi guys, I've a problem on binding GameCircle library by Amazon. They
 offer the Unity plugin for they library, I want to use classes they made
 for Unity on Monotouch. I've extracted unity plugin and now I want to use
 it on Monotouch. I've created a project and hosted it on GitHub (
 https://github.com/mapo80/GameCircle.Monotouch).

 There are two libraries: - AmazonInsightsSDK.a - GameCircle.a

 I'm using this linkWith parameters: [assembly: LinkWith
 (AmazonInsightsSDK.a, LinkTarget.ArmV7 | LinkTarget.ArmV7s |
 LinkTarget.Simulator, ForceLoad = true, IsCxx = true,
 LinkerFlags=-lsqlite3.0 -lstdc++, Frameworks = AdSupport GameKit
 MessageUI CoreTelephony SystemConfiguration Security ExternalAccessory
 Foundation)]

 [assembly: LinkWith (GameCircle.a, LinkTarget.Simulator |
 LinkTarget.ArmV7 | LinkTarget.ArmV7s, ForceLoad = true, IsCxx = true,
 LinkerFlags=-lsqlite3.0 -lstdc++, Frameworks = AdSupport GameKit
 MessageUI CoreTelephony SystemConfiguration Security ExternalAccessory
 Foundation)]

 When I reference dll on my iOS projects I obtain these errors:

 Compiling to native code /Developer/MonoTouch/usr/bin/mtouch -sdkroot
 /Applications/Xcode.app/Contents/Developer --cache
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache
 --nomanifest --nosign -sim
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.app
 -r
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleBinding/bin/Debug/Monotouch.AmazonGameCircleBinding.dll
 -r /Developer/MonoTouch/usr/lib/mono/2.1/System.dll -r
 /Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll -r
 /Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll -r
 /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll -debug -nolink -sdk
 7.0 -targetver 7.0 --abi=i386
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.exe
 Xamarin.iOS 7.0.6 Business Edition using framework:
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk
 Process exited with code 1, command:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
 -lsqlite3.0 -lstdc++ -Wl,-pie -gdwarf-2 -arch i386 -isysroot
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk
 -Qunused-arguments -fobjc-legacy-dispatch -fobjc-abi-version=2
 -mios-simulator-version-min=7.0
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/main.i386.o
 -force_load
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/AmazonInsightsSDK.a
 -force_load
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/GameCircle.a
 -o
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.app/MonotouchAmazonGameCircleTestApp
 -framework CFNetwork -framework AVFoundation -framework Accelerate
 -framework AddressBook -framework AudioToolbox -framework QuartzCore
 -framework CoreBluetooth -framework CoreData -framework CoreGraphics
 -framework CoreImage -framework CoreLocation -framework CoreText -framework
 Foundation -framework GameKit -framework ImageIO -framework
 MobileCoreServices -framework Security -framework SystemConfiguration
 -framework CoreMedia -framework CoreMIDI -framework CoreVideo -framework
 StoreKit -framework AssetsLibrary -framework Accounts -framework
 CoreTelephony -framework EventKit -framework EventKitUI -framework
 CoreMotion -framework GLKit -framework iAd -framework MapKit -framework
 MediaPlayer -framework MessageUI -framework NewsstandKit -framework
 OpenGLES -framework Social -framework Twitter -framework UIKit -framework
 PassKit -framework SpriteKit -framework JavaScriptCore -framework
 MultipeerConnectivity -framework AddressBookUI -framework SafariServices
 -framework ExternalAccessory -framework AdSupport -framework QuickLook -lz
 -liconv -u _mono_pmip -u _xamarin_init_nsthread -u
 _xamarin_get_block_descriptor -u _monotouch_get_locale_country_code -u
 _monotouch_log -u _monotouch_start_wwan -u _monotouch_timezone_get_data -u
 _monotouch_timezone_get_names -u _monotouch_IntPtr_objc_msgSend_IntPtr -u
 _monotouch_IntPtr_objc_msgSendSuper_IntPtr -u
 

Re: [MonoTouch] How do you actually listen to an UIScrollView scrolling

2014-01-02 Thread Nic Wise
As far as I know, you dont.

X.iOS has alway followed the following model:

1. you make a new object (UIScrollView on your case). It makes its own
UIScrollViewDelegate in the background, which calls the .Scrolled
events (and all the others)
2. you assign the delegate. This clears (or rather, replaces) any
events. They are still there, they just dont ever get called.

I don't think there is a way to go back from 2 to 1. Or a way to
detect which one you are in. Maybe check to see if .delegate is null
(or a specific class?) which would mean you are using the event model?






On Fri, Jan 3, 2014 at 4:52 AM, victoria iminurb...@hotmail.com wrote:
 Hi!

 I'm working with someone developing a pretty neat component, that might be
 submitted to the Xamarin component store later (or not, it's not entirely up
 to me). Without going into specifics, the end user will implement the
 component together with an existing UIScrollView, where it will listen to
 its scroll event. That's easy enough right? Well, not quite.

 In a perfect world the component would work like this:

   var target = new SomeUIScrollView();
   var component = new Component(target);

 and in the constructor we'd simply do

   target.Scrolled += magic(this, EventArgs.Empty);


 However... the above doesn't work if the UIScrollView is using an
 UIScrollViewDelegate. So, next idea was to do

   class Component : UIScrollViewDelegate
   {
 public override void Scrolled(UIScrollView scrollView)
 {
   magic(this, EventArgs.Empty);
 }
...

 and then the user would have to use or inherit from Component as their
 UIScrollViewDelegate and make sure to call the base methods if they
 themselves would override Scrolled.

 However... the above doesn't work if the user is using the event syntax.


 Question: As a third party library, how do you support both methods? If it's
 not possible, should we go with the event syntax (which feels very .NET) or
 instead implement it as an UIScrollViewDelegate (which feels more iOS)?

  / V



 --
 View this message in context: 
 http://monotouch.2284126.n4.nabble.com/How-do-you-actually-listen-to-an-UIScrollView-scrolling-tp4658518.html
 Sent from the MonoTouch mailing list archive at Nabble.com.
 ___
 MonoTouch mailing list
 MonoTouch@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/monotouch



-- 
Nic Wise
t.  +64 21 676 418 | @fastchicken
b. http://www.fastchicken.co.nz/
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Problem binding library

2014-01-02 Thread Matteo Polito
No, I have only compiled version of the library. So, nothing to do?

Thanks.

 Sent from my iPad

Il giorno giovedì 2 gennaio 2014, Jeff Stedfast ha scritto:

 It would appear that there are 2 public MD5 structs or methods in those
 native libraries and the linker doesn't know which one to use. I'm not sure
 how to solve that... do you have the source code for these native libraries?


 On Thu, Jan 2, 2014 at 4:44 PM, Matteo Polito 
 map...@gmail.comjavascript:_e({}, 'cvml', 'map...@gmail.com');
  wrote:

  Hi guys, I've a problem on binding GameCircle library by Amazon. They
 offer the Unity plugin for they library, I want to use classes they made
 for Unity on Monotouch. I've extracted unity plugin and now I want to use
 it on Monotouch. I've created a project and hosted it on GitHub (
 https://github.com/mapo80/GameCircle.Monotouch).

 There are two libraries: - AmazonInsightsSDK.a - GameCircle.a

 I'm using this linkWith parameters: [assembly: LinkWith
 (AmazonInsightsSDK.a, LinkTarget.ArmV7 | LinkTarget.ArmV7s |
 LinkTarget.Simulator, ForceLoad = true, IsCxx = true,
 LinkerFlags=-lsqlite3.0 -lstdc++, Frameworks = AdSupport GameKit
 MessageUI CoreTelephony SystemConfiguration Security ExternalAccessory
 Foundation)]

 [assembly: LinkWith (GameCircle.a, LinkTarget.Simulator |
 LinkTarget.ArmV7 | LinkTarget.ArmV7s, ForceLoad = true, IsCxx = true,
 LinkerFlags=-lsqlite3.0 -lstdc++, Frameworks = AdSupport GameKit
 MessageUI CoreTelephony SystemConfiguration Security ExternalAccessory
 Foundation)]

 When I reference dll on my iOS projects I obtain these errors:

 Compiling to native code /Developer/MonoTouch/usr/bin/mtouch -sdkroot
 /Applications/Xcode.app/Contents/Developer --cache
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache
 --nomanifest --nosign -sim
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.app
 -r
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleBinding/bin/Debug/Monotouch.AmazonGameCircleBinding.dll
 -r /Developer/MonoTouch/usr/lib/mono/2.1/System.dll -r
 /Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll -r
 /Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll -r
 /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll -debug -nolink -sdk
 7.0 -targetver 7.0 --abi=i386
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.exe
 Xamarin.iOS 7.0.6 Business Edition using framework:
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk
 Process exited with code 1, command:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
 -lsqlite3.0 -lstdc++ -Wl,-pie -gdwarf-2 -arch i386 -isysroot
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk
 -Qunused-arguments -fobjc-legacy-dispatch -fobjc-abi-version=2
 -mios-simulator-version-min=7.0
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/main.i386.o
 -force_load
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/AmazonInsightsSDK.a
 -force_load
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/GameCircle.a
 -o
 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.ap
 ___
 MonoTouch mailing list
 MonoTouch@lists.ximian.com javascript:_e({}, 'cvml',
 'MonoTouch@lists.ximian.com');
 http://lists.ximian.com/mailman/listinfo/monotouch



___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch