3

I'm trying to integrate InApp purchase & a native SDK provided by our publisher into a game made with Haxe & NME. I'm still using NME 3.5.5 & hxcpp 2.10.

I tried to use Native Extension as described here : http://www.openfl.org/developer/forums/programming-haxe/connecting-objective-c-haxe-ios-help/ and here : https://github.com/ericamccowan/Haxe_Extension_Test

I first tested it on windows, doing simple things in cpp, I had no problems passing and receving data.

I switched onto the mac, and tried to do the same for iOS, but I can't even manage to launch the game properly. I compiled the extension with the appropriate command, and then included the ".a" generated into the xcode project. But when I tried to run the game on an ipad via xcode, as usual, I got this :


(source: gyazo.com)

Here a look at what the project looks like

http://gyazo.com/ff6352a2bb7b2034c933b8305b711c48.png

Since the problem is localised on the "iOS_Native_register_prims()" in the Main.mm, I think it's a matter of xcode nor recognizing the native extension? I tried adding the iOS_Native.mm to the project, but then it threw an error because he was unable to include hxcpp.h

I realize I'm not really clear about all this, but that's because I don't quite understand how that should work... Does anyone ever tried something similar?

Thansk in advance for your help !

Glorfindel
  • 21,988
  • 13
  • 81
  • 109

1 Answers1

0

It sounds like you are missing a reference to the function iOS_Native_register_prims. The function declaration doesn't have to do anything other than return 0 but can also be used to initialize parts of your extension.

extern "C" int iOS_Native_register_prims () { return 0; }

The function name should match the project name so if you were creating a GameCenter extension it would be named GameCenter_register_prims.

Matt Tuttle
  • 410
  • 2
  • 6