Search
 
SCRIPT & CODE EXAMPLE
 

CPP

how to interface c++ in haxe

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 <iostream>
class Geeks 
{ 
    public: 
 		static helloFromCpp(){
         std::cout << "hello from cpp!"; 
        }
      
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: vs code text in line 
Cpp :: c++ while loop decrement 
Cpp :: pairs 
Cpp :: matrix layout in C++ 
Cpp :: expected number of trials to get n consecutive heads 
Cpp :: c++ string to wstring 
Cpp :: How to block window resize sfml c++ 
Cpp :: void value not ignored as it ought to be 
Cpp :: return the index where maximum element in a vector 
Cpp :: c++ split long code 
Cpp :: c++ stream string into fiel 
Cpp :: priority queue c++ time complexity 
Cpp :: Array implementation of Queue using class in c++ 
Cpp :: finding no of unique characters in a string c++ 
Cpp :: c++ get last character of string 
Cpp :: addition without arithmetic operators c++ 
Cpp :: c++ find largest number in array 
Cpp :: how to play sound in c++ 
Cpp :: c++ read integers from file 
Cpp :: switch in c++ 
Cpp :: how to run a c++ program in the background 
Cpp :: find in set of pairs using first value cpp 
Cpp :: how to compare lower case character to uppercase cpp 
Cpp :: random number in a range c++ 
Cpp :: time function c++ 
Cpp :: split string on character vector C++ 
Cpp :: int_max cpp 
Cpp :: c++ typeid 
Cpp :: c++ typing animation 
Cpp :: char ascii c++ 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =