Compiling libraries without main class - Compilation - Haxe programming language cookbook
In most cases, you want a Main class with a static main function as entry point to start your program. However, there are cases where there is no need for this - for example if you are writing a library that other programs will be using.