I am just starting to learn openfl. After I built my first project with command “openfl build neko”, I run the application located in “…/neko/bin”. The program just instantly quit after I run it. How can I solve this problem? Thanks.
There’s a bug somewhere in your app, maybe you just forgot putting a semicolon or something like that. So you need to see debug info or some output. You might want to see the console of your IDE or just compile for Flash for debug info. If you want debug info for Flash, make sure to install the debug Flash Player for your OS.
Be sure to compile in debug mode lime test neko -debug to get the most infos.
Also know that neko’s default values are null and not 0 for int and floats, and any operation like addition,multiplication… between a number and a null will result in a crash.
You may also want, like @Alex said, to compile to another target to compare, try the mac target since it is the closest, though win/linux/mac targets don’t have null as default value so this kind of bug won’t appear in these targets.
Not sure if that will work on mac, but try ```ldd `which neko````
and see if it’s compiled against 32 or 64 bits library, on linux they are respectively in /lib/ and /lib64/.
If you want to go from 32 to 64 neko simply remove everything from neko,
for me on linux it’s /usr/lib/libneko.so, /usr/lib/neko/, /usr/bin/neko, /usr/bin/nekoc and /usr/bin/nekotools,
and then simply install the new one like the old one was.
I searched the web, it seems that I do have the 64-bit Neko, otherwise system would give a prompt that certain .dll files could not be found.
It’s really strange…I enter the application package contents folder, run the program in /MacOS, here’s the log:
Zhus-MacBook-Pro:~ zetasq$ /Users/zetasq/Desktop/HelloWorld/Export/mac64/neko/bin/HelloWorld.app/Contents/MacOS/HelloWorld ; exit;
Called from openfl/_v2/utils/ByteArray.hx line 757
Called from openfl/_v2/Lib.hx line 248
Called from openfl/_v2/Lib.hx line 391
Called from openfl/_v2/Lib.hx line 193
Called from /usr/lib/haxe/std/neko/Lib.hx line 30
Uncaught exception - load.c(237) : Failed to load library : lime.ndll (dlopen(lime.ndll, 1): image not found)
Just now I use terminal to run my program like “./Helloworld”, it runs successfully.
But then I double-clicked the file in finder the program still quit instantly. What’s the difference between terminal run and click run?
It has to do with the current working directory when running the application, Neko has some known issues in findings it’s libraries at runtime, I would recommend using a standard c++ build at this time, long-term I’m looking at whether Java, node.js or patches to Neko would be ideal for a dynamic desktop target