【问题标题】:Issues running haxe application in osx terminal with createjs library使用 createjs 库在 osx 终端中运行 haxe 应用程序的问题
【发布时间】:2015-11-22 16:11:39
【问题描述】:

运行此命令时

haxe -main Main.hx

我收到了这个错误

Main.hx:2: characters 7-33 : Type not found : createjs.easeljs.Container

Main.hx

package ;
import createjs.easeljs.Container;
import createjs.easeljs.Shape;
import createjs.easeljs.Stage;
import createjs.easeljs.Text;
import createjs.easeljs.Ticker;
import js.Browser;
import js.html.CanvasElement;
import js.html.Element;

我已经包含了 createjs 库的 javascript 文件,并且我还使用命令安装了该库

haxe install createjs

【问题讨论】:

    标签: command-line haxe createjs haxelib


    【解决方案1】:

    您必须在编译期间将 createjs haxelib 与 -lib 参数包括在内:

    haxe -main Main.hx -lib createjs

    【讨论】:

    • 我现在收到此错误,但它指向 createjs 库中的代码 /Users/Vincent/Repos/skytroops/bin/js/createjs/1,5,8/createjs/easeljs/ColorMatrix.hx:13: characters 8-50 : Invalid number of type parameters for Array
    • 这是一种不同的用法,我无法重现。您的代码是什么样的,您的 Haxe 版本是什么 (haxe -version)?
    • 我的haxe版本是3.2.1
    • 设法重现它 - 这是外部定义的问题。在该文件的第 13 行和第 14 行将 Array 更改为 Array<Dynamic> 可修复编译器错误。我建议你在CreateJS-Haxe GitHub repo 上打开一个问题。
    • 虽然might be possible,但它很不寻常。 .js 文件为generally executed in a browser。
    猜你喜欢
    • 2015-11-21
    • 2021-08-04
    • 1970-01-01
    • 2018-01-08
    • 1970-01-01
    • 1970-01-01
    • 2023-03-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多