1

The monotouch binding that I created for the Wikitude SDK framework does not work at run time. I created my binding by following these instructions: https://stackoverflow.com/a/13070064/42826.

When I try to instantiate my wrapper class at run-time, I get the following exception:

Wrapper type 'Wikitude.WTArchitectView' is missing its native ObjectiveC class 'WTArchitectView'.

It looks like the native class WTArchitectView goes not get loaded by the binding assembly at run-time. The native library WikitudeSDK.a is indeed located in the binding assembly with the ObjcBindingNativeLibrary build action.

Here is my LinkWith declaration (notice the -ObjC that is required by the Wikitude native library):

[assembly: LinkWith ("WikitudeSDK.a", LinkTarget.ArmV7 | LinkTarget.Simulator, Frameworks = "CoreVideo Security SystemConfiguration CoreMedia AVFoundation CFNetwork CoreLocation CoreMotion MediaPlayer OpenGLES QuartzCore CoreGraphics", ForceLoad = true, LinkerFlags = "-ObjC", IsCxx = true)]

Most of my ApiDefinition.cs was created using Objective Sharpie. Note: I only left a single function for testing purposes.

namespace Wikitude
{
    [BaseType (typeof (UIView))]
    interface WTArchitectView {

        [Export ("initializeWithKey:motionManager:")]
        void InitializeWithKey (string key, NSObject motionManager);
    }
}

Here is the Wikitude SDK header file: http://pastebin.com/HKBED11u

My project has the ARMv7 + ARMv7s supported architectures.

Do I have to force loading the native library somehow or did I simply miss something obvious to get the wrapper to work?

Community
  • 1
  • 1
Frederic
  • 2,034
  • 3
  • 18
  • 22

1 Answers1

2

The LinkWith attribute only mention ArmV7 and Simulator as LinkTargets. If your device is Armv7s, this could explain why it doesn't work.

Stephane Delcroix
  • 16,134
  • 5
  • 57
  • 85
  • Thanks. For some reason as soon as I changed the supported platform I started to see linking errors with the native lib, which explains why it would not load. My test phone is a iPhone 4 (Armv7). – Frederic May 11 '13 at 11:28