In Haxe hxml file, how to target main class not in the root package

I'm trying to compile a project where the main entry point isn't in the root package (which virtually all examples use, e.g. -main Main), but I keep getting this error message:

Error: Invalid commandline class : rtp.qt.QTPrinter should be QTPrinter

Here are the various syntaxes that should work:

-cp src
-main rtp.qt.QTPrinter

Or:

-cp src
-main rtp/qt/QTPrinter.hx

Answers


It turns out, those syntaxes are both fine. I had just moved the QTPrinter.hx file from src/ to src/rtp/qt/ directory and I forgot to update the package statement at the top of the file (hence the invalid commandline class error.)

In my src/rtp/qt/QTPrinter.hx file, fix the package statement:

package rtp.qt;

I'm posting this mistake in hopes it helps someone. Cheers!


Need Your Help

Are inline functions in C/C++ a way to make them thread-safe?

c++ c multithreading thread-safety

I make the following reasoning, please tell me what's wrong (or right) about it:

Are multiple build tools (qmake + scons) on the same project considered bad practice?

c++ build qmake scons

My program depends on two libraries. The first one uses scons and the last one uses qmake. The program itself uses scons. So to build the whole project, I have a makefile that builds the first libr...