I cloned the openfl-extension-example from github: https://github.com/labe-me/openfl-extension-example
I build it using:
haxelib run hxcpp Build.xml -Diphonesim
Than I try to include it in my project.xml:
When running the project using
lime test ios -Dv2 -Dpure_pro -debug -simulator
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" />.
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
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);