Invalid commandline class : src.Main should be Main

Hi, I was doing a test project in Haxe, when I tried to build it I got this error:

Invalid commandline class : src.Main should be Main

image

Main.hx

class Main {
	static function Main() {
		trace("Hello, world!");
	}
}

build.hxml

-cp src
-D analyzer-optimize
-main Main

Current dir: PS C:\Users*********\OneDrive\Área de Trabalho\2dtest>

Can somebody help me please?

I’m not sure if this solves your entire problem but change the static function to lowercase:

	static function main():Void {
		trace("Hello, world!");
	}