COMMUNITY

Compile error, when using UnityEditor.dll

haxe
-cp src
-D net-ver=40
-D no_debug
-net-lib /Applications/Unity/Unity.app/Contents/Managed/UnityEngine.dll
-net-lib /Applications/Unity/Unity.app/Contents/Managed/UnityEditor.dll
-D real-position
-D no_root
-D rtti
-D unity
-D dll
--main EditorProject
--cs out
-xml out/xml/api.xml
cp.hxml
-cp macro
--macro "CompilerMacro.run()"

Error Info

PeReader.Error_message("Error reading compressed data. Invalid first byte: ff")

If i only keep -net-lib …/UnityEngine.dll
Everything is ok.

Some haxe source code infomation
ilMetaReader.ml
https://github.com/HaxeFoundation/ocamllibs/blob/master/ilib/ilMetaReader.ml

let read_compressed_i32 s pos =
	let v = sget s pos in
	(* Printf.printf "compressed: %x (18 0x%x 19 0x%x)\n" v (sget s (pos+20)) (sget s (pos+21)); *)
	if v land 0x80 = 0x00 then
		pos+1, v
	else if v land 0xC0 = 0x80 then
		pos+2, ((v land 0x3F) lsl 8) lor (sget s (pos+1))
	else if v land 0xE0 = 0xC0 then
		pos+4, ((v land 0x1F) lsl 24) lor ((sget s (pos+1)) lsl 16) lor ((sget s (pos+2)) lsl 8) lor (sget s (pos+3))
	else
		error (Printf.sprintf "Error reading compressed data. Invalid first byte: %x" v)

:+1:Fixed by kLabz
https://github.com/HaxeFoundation/haxe/issues/9946