📅  最后修改于: 2022-03-11 14:44:48.780000             🧑  作者: Mango
Im not exactly sure how this works but it do....
Haxe file:
@:include("helloWorld.cpp")
@:native("cppClass")
extern class CppClass {
@:native("cppClass::helloFromCpp") static public function helloFromCpp():Void;
}
class Main {
static public function main() {
CppClass.helloFromCpp();
}
}
CPP file ( called helloWorld.cpp):
#include
class Geeks
{
public:
static helloFromCpp(){
std::cout << "hello from cpp!";
}
}