如何将外部库包含到Haxe中
How do you include external libraries into Haxe?
我正在尝试编写一个程序,我想在Haxe中使用一些外部C++库。我真的搞不清楚,因为官方文件太旧了(http://old.haxe.org/doc/cpp/ffi)而且我对C++也不熟悉。
那么你在哈克塞是怎么做到的呢?我想我需要通过haxelib
安装hxcpp
,但这已经是我所知道的了。
首先,请查看Hugh Sanderson的C++Magic。演讲中提到的编译器元数据可以在Haxe手册的内置编译器元数据页面中找到。
然后,他简要地谈到了元数据的魔力。他为类和函数提供元数据。对于课程,您有以下内容:
@:headerClassCode(...) which injects member variables and inline functions. @:headerCode(...) which includes external headers. @:headerNamespaceCode(...) which allows you to add to the global namespace. @:cppFileCode(...) which allows you to include external headers only in C++ files. @:cppNamespaceCode(...) which implements static variables. @:buildXml(...) which allows you to add to the build.xml file.
对于函数元数据,您可以得到以下内容:
@:functionCode(...) @:functionTailCode(...)
休表示,这些基本上是多余的,因为你应该使用非打字__改为cpp_(…)。
相关文章:
- 如何导出包含具有"std::unique_ptr"值的"std::map"属性的
- 从包含m行的文件中提取n行,必要时(惰性地)重复该文件
- 编译包含字符串的代码时遇到问题
- c++库的公共头文件中应该包含什么
- 将包含C样式数组的对象初始化为成员变量(C++)
- 是否需要删除包含对象的"pair"?
- 函数何时会在c++中包含stack_Unwind_Resume调用
- 如何将包含epoch时间的十六进制字符串转换为time_t
- 使用mongocxx驱动程序时包含头文件问题
- 如何在h文件中包含.o对象文件
- 在混合代码库中将C转换为C++时出现许多包含错误
- VS2017,C++包含目录与附加包含目录,子文件夹包含失败-但为什么
- cmath抛出错误C2062、C2059、C2143和C2447.cmath包含在矢量文件中
- 为什么您需要C++头文件的包含保护
- 无法在UE4中包含BP类到CPP类
- g++ 说函数不存在,即使包含正确的标头
- 在C++代码中包含opencv时,使用ctypes创建.so文件
- Visual C++GC接口如何启用它以及要包含哪个库
- 如何在我的Haxe / hxcpp构建中包含libsqlite3
- 如何将外部库包含到Haxe中