I got the same following the Hello World / Hello Hashlink examples.
There is no package defined in these examples. I did try adding one in case it was always expecting a package but the error persists.
Turned out the issue was the comments in the hxml file - for some reason it was not recognising the comment at the end of the -main line, and was trying to load “Main # Tells haxe to […]” as the entry point.
I just moved the comments on to their own lines and everything works (note this is the hashlink hxml):
# Tells haxe where to search for your code files
-cp src
# Tells haxe to import the heaps library
-lib heaps
# Tells haxe to import the hlsdl rendering library
-lib hlsdl
# Tells haxe to compile to hashlink bytecode in the project directory
-hl hello.hl
# Tells haxe that Main.hx is your entry point
-main Main
# Tells haxe to run in debug mode
-debug