0
votes

I'm trying to compile a simple hello world Haxe example in MonoDevelop on osx.

class Test {
    static function main() {
        trace("Hello World !");
    }
}

When I try to build, I'm getting the error: "Invalid class name Test".

I've tried renaming the class in both the hx and hxml files to something else but get the same error but now with the new class name.

Any ideas?

1

1 Answers

2
votes

Ok, I figure it out. It was because the .hx file was utf-8 encoded and needed to be ansi (windows) encoded.

You can fix the problem by running the following from a terminal (navigate to the directory containing your file first!).

sudo iconv -f UTF-8 -t WINDOWS-1253 test.hx > test.hx