Spooikypok_Dev
Spooikypok_Dev

Reputation: 183

Can't build Haxe source file

I tried haxe on MacOS, and setup the toolchain correctly, etc., but when i tried to compile a file, i got an error, so i tried again with an example in the tutorial (here: https://haxe.org/documentation/introduction/language-introduction.html), and got the same error, which is:

Type not found : HelloWorld

for the command:

haxe -main HelloWorld -js HelloWorld.js

to compile the file:

class HelloWorld {
    static public function main() {
      trace("Hello World");
    }
}

What am i doing wrong?

Upvotes: 1

Views: 140

Answers (1)

KevinResoL
KevinResoL

Reputation: 982

Make sure that your haxe source file is named as HelloWorld.hx and your working directory is at where the source file is, when you run the compile command

Upvotes: 2

Related Questions