Error while compiling openfl sample [Solved]

Hi, I’ve this error when trying to compile one of the samples of openfl. After this command line:

openfl create sample SimpleSWFLayout

I’ve opened it with FlashDevelop, but got this error:

  Called from openfl/_legacy/utils/ByteArray.hx line 758
  Called from openfl/_legacy/Lib.hx line 284
  Called from openfl/_legacy/Lib.hx line 427
  Called from openfl/_legacy/Lib.hx line 219
  Called from /usr/lib/haxe/std/neko/Lib.hx line 30
  Uncaught exception - load.c(237) : Failed to load library : lime-legacy.ndll

Tried it with Flash or HTML5, with -Dlegacy and even a full fresh reinstall of openfl after removing.
Nothing helps.

A different project, witch is not based on one of the samples, and comtains a use of png and attaching it to stage, got this error after the upgrade to openfl 3, but worked before:

 C:/HaxeToolkit/haxe/lib/lime/2,2,2/lime/utils/ByteArray.hx:1162: characters 0-19 : Class not found : flash.utils.ByteArray

Even when compiling with -Dlegacy.


I don’t think you can use lime 2.2.2 with openfl 3,
you should retry with lime 2.3.1.

It does it automatically, I don’t really know how to control it…

You can see the libs installed with haxelib list,
the version between brackets is the selected one,
to change it do haxelib set lib version.

For instance haxelib set lime 2.3.1.

Hi, I did exactly it. However, eventually FlashDevelop say I still got lime 2.2.2, and I get exactly the same error as above.

Oh I see, it didn’t install lime, the version of haxelib you have is broken.

Do haxelib selfupdate and then redo haxelib set lime 2.3.1.

Thanks! It worked.
However, now I’m getting another error:

C:/HaxeToolkit/haxe/lib/swf/1,8,4/format/swf/SWFLibrary.hx:13: characters 7-28 : Class not found : flash.utils.ByteArray

I’ve tried to upgrade all the libraries, and got this:

Could you try another sample, like DisplayingABitmap, to see if that builds correctly? Otherwise I think there might be something wrong with your install. For HTML5 and native targets, OpenFL remaps the “flash” package to “openfl”, so flash.utils.ByteArray should compile as openfl.utils.ByteArray, which should exist

Hi, For both projects, I get the above error for the flash target, and this error for the HTML5 target:

C:/HaxeToolkit/haxe/lib/lime/2,3,1/lime/graphics/opengl/GLShaderPrecisionFormat.hx:14: characters 0-33 : Class not found : js.html.webgl.ShaderPrecisionFormat

What version of haxe do you have?

For the Flash target? Are you missing C:\HaxeToolkit\haxe\std\flash\utils\ByteArray.hx or something? :slight_smile:

Yes… :flushed:

Haxe version: 3.2.0 this is a release candidate, mybe I should downgrade to the stable 3.1.3 ?

Your Haxe install looks broken, I’m using Haxe 3.2 RC2 and it’s working fine. Maybe try installing it one more time. You should have “C:\HaxeToolkit\haxe\std” with ByteArray.hx and other files, you seem to be missing some, somehow

Yes, reinstalling haxe 3.2 solved the problem! Thank you.