📜  如何在 haxe 中连接 c++ - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:48.780000             🧑  作者: Mango

代码示例1
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!"; 
        }
      
}