Openfl-extension-example not working on iphone


I cloned the openfl-extension-example from github:

I build it using:

cd project
haxelib run hxcpp Build.xml -Diphonesim

Than I try to include it in my project.xml:

<source path="../openfl-extension-example/>

When running the project using

lime test ios -Dv2 -Dpure_pro -debug -simulator

I get:

Primitive not found : testextension_sample_method__1 Primitive not found : testextension_tweet__1

I try this because I want to build my own extension and get the same error. What could be wrong?


Now I wonder if it is my setup, or a bug. Can anyone confirm?

You can’t just add a <source /> node, if you do this it won’t parse the include.xml and so won’t add the ndll and you’ll get the errors you have.

You need to add it to your haxelibs: haxelib dev openfl-extension-example path/to/openfl-extension-example and use <haxelib name="openfl-extension-example" />.

1 Like

You may also need lime rebuild openfl-extension-example ios or something similar, if the NDLL is not included

Now it works. And my own extension did not work because a function with 8 paramters must be registered using DEFINE_PRIM_MULT.


Yeah, I think the limit is five (before it turns into an array). It’s a little tricky :wink:

What else do I have to make different when I have > 5 parameters? I am trying to access the parameters (with for example val_string) and it keeps crashing on me …

Got it, I have to write the objective-c function like this:

static void function(value* paramerters, int count);