haxe 代码非常简单:
主文件.hx
package nekotest;
class Main {
public static function main() {
var name = neko.System.args()[0];
trace("Hello " + name);
trace("Your name is " + Std.string(name.length) + " characters longs.");
}
}
在控制台中:
E:\WORKSPACE\HaxeTest\src>haxe -main nekotest.Main -neko test.n
nekotest/Main.hx:6: characters 19-35 : Unknown identifier : neko
haxe 和 neko 都安装好了:
E:\WORKSPACE\HaxeTest\src>haxe
Haxe Compiler 2.10 - (c)2005-2012 Motion-Twin
Usage : haxe.exe -main <class> [-swf|-js|-neko|-php|-cpp|-cs|-java|-as3] <output> [options]
Options :
-cp <path> : add a directory to find source files
-js <file> : compile code to JavaScript file
-swf <file> : compile code to Flash SWF file
E:\WORKSPACE\HaxeTest\src>neko
NekoVM 1.8.2 (c)2005-2011 Motion-Twin
Usage : neko <file>
我错过了什么吗?