Lua调用C++的函数
2016-03-25 14:19
471 查看
#include "Study.h"
Study::Study()
{
}
Study::~Study()
{
}
int Study::ceshi(lua_State*L)
{
cout<<"测试成功"<<endl;
return 0;
}
int main()
{
int i = 0;
Study *study = new Study();
lua_State * L = luaL_newstate();
luaL_openlibs(L);
lua_register(L, "ceshi", Study::ceshi);
luaL_dofile(L, "2.lua");
getchar();
return 0;
}
/***********************************2.lua*******************************************/
ceshi();
Study::Study()
{
}
Study::~Study()
{
}
int Study::ceshi(lua_State*L)
{
cout<<"测试成功"<<endl;
return 0;
}
int main()
{
int i = 0;
Study *study = new Study();
lua_State * L = luaL_newstate();
luaL_openlibs(L);
lua_register(L, "ceshi", Study::ceshi);
luaL_dofile(L, "2.lua");
getchar();
return 0;
}
/***********************************2.lua*******************************************/
ceshi();
相关文章推荐
- lua基础语法2
- 基于ngx_lua模块的waf开发实践
- lua学习参考
- C++遍历Lua二维table
- Lua中模式匹配
- Lua Coroutine 的简单使用
- lua_c++
- Lua笔记19 面向对象实现__index
- Lua笔记18 面向对象类 self和this
- Lua笔记17 面向对象类
- Lua笔记16 __tostring
- C++混合编程之idlcpp教程Lua篇(3)
- lua eval
- ceilometer-alarm-notifier/evaluator服务的初始化和启动
- lua基础语法
- C++调用Lua函数
- C++将结构体传给lua
- Lua和C++语言的交互详解
- LUA 怎么理解coroutine ?
- lua脚本入门