I have a class in cpp like:
class Foo{
private:
int x;
public:
Foo(){x = 0;}
int incr();
};
int Foo::incr(){
x++;
return x;
}
In any .hx file, I want to use Foo class which is defined in cpp like that:
var number:Int;
// Some codes to create foo_1 object "Foo foo_1;"
// Some codes to call "number = foo_1.incr();"
trace("x is:" + number);
// Some codes to call "number = foo_1.incr();"
trace("x is:" + number);
Expected output is
x is:1
x is:2
As a note, I searched and read some documents about hxcpp and Haxe CFFI but some parts of these documentations are too complicated. I'm beginner in Haxe and I need basic and simple steps to solve this problem. Thanks.