内容简介:VS2013编译Lua5.3.x动态链接库
首先先从官网下载 Lua 5.3.x源码 http://www.lua.org/download.html
打开VS2013 IDE 新建一win32空项目
右击项目选择添加 添加除了lua.h、lua.c、lualib.h、luac.c以外的所有后缀为.h和.c的文件。
编译生成
测试下动态链接库
建一空的win32项目
右击项目属性 进行配置
输入外部的dll链接库的目录
头文件引入以下五个文件
建一测试 main.cpp文件 内容如下
#include <iostream>
using namespace std;
#include "lua.hpp"
int main()
{
lua_State *l = luaL_newstate();
luaL_openlibs(l);
luaL_dofile(l, "main.lua");
lua_close(l);
system("pause");
return 0;
}
在建一 main.lua文件 内容如下
print("hello world")
编译生成
进行调试 在调试之前 先把 dll放在exe同目录下
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Learn Python 3 the Hard Way
Zed A. Shaw / Addison / 2017-7-7 / USD 30.74
You Will Learn Python 3! Zed Shaw has perfected the world’s best system for learning Python 3. Follow it and you will succeed—just like the millions of beginners Zed has taught to date! You bring t......一起来看看 《Learn Python 3 the Hard Way》 这本书的介绍吧!