after build - Class not found

46 views
Skip to first unread message

skittles

unread,
Apr 3, 2015, 4:37:58 AM4/3/15
to haxe...@googlegroups.com
Still in the beginning - i ca not find a topic on this, so another starter-question.

When i compile my php Application with this build.hxml
-main Application
-cp hx
-php .

it compiles without errors but i get an error in browser that a class is not found.


package ;

import com.skittles.haxe.util.DataBaseUtil;

class Application 
{
public static function main()
{
com.skittles.haxe.util.DataBaseUtil.pdoTest();
}
}


the compiled php file:

<?php

class Application {
public function __construct(){}
static function main() {
        com_skittles_haxe_util_DataBaseUtil::pdoTest();
}
function __toString() { return 'Application'; }
}
?>

and the error is

Fatal error: Class 'com_skittles_haxe_util_DataBaseUtil' not found in .../Application.class.php

How can i define the regular php import which is missing to compile properly?

Thanks again for helping at my first steps in haxe.


skittles

unread,
Apr 7, 2015, 12:47:41 AM4/7/15
to haxe...@googlegroups.com
I still do not have any working Class-Construct in php.
anybody working w/ haxe and php-target who could give me an advice? Am i missing some compiler arguments?

Thx!

Andy Li

unread,
Apr 7, 2015, 1:06:08 AM4/7/15
to haxe...@googlegroups.com
Give us a minimal example that reproduces your problem.
Similar to the following:

Test.hx
import pack.DataBaseUtil;
class Test {
static function main() {
DataBaseUtil.pdoTest();
trace("ok");
}
}

pack/DataBaseUtil.hx
package pack;
class DataBaseUtil {
static public function pdoTest():Void {

}
}

build.hxml
-main Test
-php bin

Compile and run
haxe build.hxml
php bin/index.php

It correctly traced "Test.hx:5: ok" without any error.

Best,
Andy

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

skittles

unread,
Apr 7, 2015, 1:34:48 AM4/7/15
to haxe...@googlegroups.com
Hey Andy Li,

thx for quick reply, after trying your setup, the main error was to set the php-compile.path to "." and not like you did in an extra folder like "bin"

not working :
-main Test
-cp hx
-php .

working:
-main Test
-cp hx
-php bin

now i get the expected php-responses i need to get going!

Awesome!
( i'll remember to put that setup to reproduce issues in the forum next time i have a question! )




Am Freitag, 3. April 2015 10:37:58 UTC+2 schrieb skittles:
Reply all
Reply to author
Forward
0 new messages