haXe Forum > Class path?
-
Kris Worytkiewicz Feb 03 at 23:39
Hi List,
I am stuck with a newbie problem. So I have the files
1. Gaga.hx with code
class Gaga {
static function main() {
var g = new RadioGaga();
g.gaga();
}
}2. G.hx with code
class RadioGaga {
public function gaga () {
trace ("All we hear");
}public function new () {}
}These files are in the same directory. The HaXe compiler doesn't find the class RadioGaga:
[75] ~/Software/Flash/Haxe/FirstHacks/Gaga haxe -main Gaga -swf9 gaga.swf -cp ./
./Gaga.hx:3: characters 10-25 : Class not found : RadioGagaI also tried a package declaration, with similar results...
Any comment welcome :-)
Kris
-
aulia Feb 04 at 03:46
Change
G.hxtoRadioGaga.hx. -
ThinkTwice Feb 04 at 03:47
Hi,
It needs you to assign an environment variable called `HAXE_LIBRARY_PATH`. For instance, provided you are using bash as login shell on Linux-like system, issue the command `export HAXE_LIBRARY_PATH=$HAXE_LIBRARY_PATH:.`
Hope it helps,
;) -
Philipp Klose Feb 04 at 04:13
Often reading in the documentation helps: Packages and Imports
Classnames must be the same as the filenames. Folder structure must be the same as the package structure. -
Ali Jaya Meilio Feb 04 at 10:09
try to import G instead of RadioGaga, the import thingy is refer to the filename *IMHO
-
Kris Worytkiewicz Feb 12 at 00:11
Many thanks to all :-) Haxe's module system can be confusing at boot time...