Compile error - Haxe 4 + OpenFL + AIR desktop app

Hello - I have been trying to update an old AIR-based tool to use Haxe 4 + OpenFL.

I created a new AIR app in FlashDevelop and pointed it at the Haxe 4.0.5 SDK…
(This led to compile errors in the haxe air3 lib, so I switched to another library “air4haxe” which fixes the problems.)
At this point a simple test app which simply displays a bitmap could compile and run.

Then I added a reference to OpenFL (8.9.5), but the build fails during compile at:
...\openfl\8,9,5\src\openfl\utils\ByteArray.hx:344: characters 3-19 : Recursive implicit cast

This error can be seen by simply importing ByteArray:
import openfl.utils.ByteArray;

Wondering if anyone else has seen and solved this problem.

Thanks!

Does it give the same error if you have a project.xml and use the openfl test air command to do your build?

OpenFL 8.x is not designed to compile directly from HXML using -lib openfl but instead expects to be built using the OpenFL command-line tools

Yes, I think using FlashDevelop to create the project was the problem.

Today I created a test app via “openfl create …” and this works fine.

Thanks for your reply!

1 Like