C++ Lua binding
功能:从Lua中调用C++定义的方法,在c++中跑Lua脚本
情景:提供高级,抽象的解决方法,无需c++重新编译。
实现原理
C中调用Lua。 一个CAPI和栈实现。
仔细的解释可以看blog
Lua中调用C
C中函数导出动态链接库
Lua运行时候require
需要加载动态库
关于如何在vs中编译dll 和 def使用说明
lua调用c++dll 简单案例
windows写一个dll
tolua-accessing c/c++ code from Lua
tolua 是一种解决方案。
可以看使用 tolua 实现 lua 与 c++ 交互
zeus中也是使用这个方法的。注册函数给lua使用,同时也在cpp中call dofile方法
extern “C”
What extern “C” does is affect linkage. C++ functions, when compiled, have their names mangled – this is what makes overloading possible. The function name gets modified based on the types and number of parameters, so that two functions with the same name will have different symbol names.
kaguya
header-file only
seamless access to lua elements
资源
todo
cmake的组织方法