VC编译lua库 出现错误:

错误  36  error LNK1120: 21 个无法解析的外部命令    C:\Users\luozhuang\Desktop\onscripter-20120416VC\Release\onscripter.exe onscripter
错误  19  error LNK2019: 无法解析的外部符号 "char const * __cdecl lua_tolstring(struct lua_State *,int,unsigned int *)" (?lua_tolstring@@YAPBDPAUlua_State@@HPAI@Z),该符号在函数 "public: int __thiscall LUAHandler::callFunction(bool,char const *)" (?callFunction@LUAHandler@@QAEH_NPBD@Z) 中被引用   C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter
错误  32  error LNK2019: 无法解析的外部符号 "char const * __cdecl luaL_checklstring(struct lua_State *,int,unsigned int *)" (?luaL_checklstring@@YAPBDPAUlua_State@@HPAI@Z),该符号在函数 "public: bool __thiscall LUAHandler::isCallbackEnabled(int)" (?

isCallbackEnabled@LUAHandler@@QAE_NH@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 29 error LNK2019: 无法解析的外部符号 "int __cdecl lua_error(struct lua_State *)" (?lua_error@@YAHPAUlua_State@@@Z),该符号在函数 "public: bool __thiscall LUAHandler::isCallbackEnabled(int)" (?isCallbackEnabled@LUAHandler@@QAE_NH@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 28 error LNK2019: 无法解析的外部符号 "int __cdecl lua_pcall(struct lua_State *,int,int,int)" (?

lua_pcall@@YAHPAUlua_State@@HHH@Z)。该符号在函数 "public: void __thiscall LUAHandler::init(class ONScripter *,class ScriptHandler *)" (?

init@LUAHandler@@QAEXPAVONScripter@@PAVScriptHandler@@@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 18 error LNK2019: 无法解析的外部符号 "int __cdecl lua_toboolean(struct lua_State *,int)" (?

lua_toboolean@@YAHPAUlua_State@@H@Z),该符号在函数 "public: bool __thiscall LUAHandler::isCallbackEnabled(int)" (?isCallbackEnabled@LUAHandler@@QAE_NH@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 17 error LNK2019: 无法解析的外部符号 "int __cdecl lua_tointeger(struct lua_State *,int)" (?lua_tointeger@@YAHPAUlua_State@@H@Z),该符号在函数 "public: bool __thiscall LUAHandler::isCallbackEnabled(int)" (?isCallbackEnabled@LUAHandler@@QAE_NH@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 33 error LNK2019: 无法解析的外部符号 "int __cdecl luaL_checkinteger(struct lua_State *,int)" (?luaL_checkinteger@@YAHPAUlua_State@@H@Z),该符号在函数 "public: bool __thiscall LUAHandler::isCallbackEnabled(int)" (?isCallbackEnabled@LUAHandler@@QAE_NH@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 34 error LNK2019: 无法解析的外部符号 "int __cdecl luaL_loadbuffer(struct lua_State *,char const *,unsigned int,char const *)" (?luaL_loadbuffer@@YAHPAUlua_State@@PBDI1@Z),该符号在函数 "public: void __thiscall LUAHandler::init(class ONScripter *,class ScriptHandler *)" (?init@LUAHandler@@QAEXPAVONScripter@@PAVScriptHandler@@@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 35 error LNK2019: 无法解析的外部符号 "struct lua_State * __cdecl luaL_newstate(void)" (?luaL_newstate@@YAPAUlua_State@@XZ)。该符号在函数 "public: void __thiscall LUAHandler::init(class ONScripter *,class ScriptHandler *)" (?

init@LUAHandler@@QAEXPAVONScripter@@PAVScriptHandler@@@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 15 error LNK2019: 无法解析的外部符号 "void __cdecl lua_close(struct lua_State *)" (?

lua_close@@YAXPAUlua_State@@@Z)。该符号在函数 "public: __thiscall LUAHandler::~LUAHandler(void)" (?

?1LUAHandler@@QAE@XZ) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 26 error LNK2019: 无法解析的外部符号 "void __cdecl lua_getfield(struct lua_State *,int,char const *)" (?lua_getfield@@YAXPAUlua_State@@HPBD@Z),该符号在函数 "public: int __thiscall LUAHandler::callFunction(bool,char const *)" (?callFunction@LUAHandler@@QAEH_NPBD@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 24 error LNK2019: 无法解析的外部符号 "void __cdecl lua_pushboolean(struct lua_State *,int)" (?

lua_pushboolean@@YAXPAUlua_State@@H@Z),该符号在函数 "public: bool __thiscall LUAHandler::isCallbackEnabled(int)" (?isCallbackEnabled@LUAHandler@@QAE_NH@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 22 error LNK2019: 无法解析的外部符号 "void __cdecl lua_pushinteger(struct lua_State *,int)" (?lua_pushinteger@@YAXPAUlua_State@@H@Z),该符号在函数 "public: bool __thiscall LUAHandler::isCallbackEnabled(int)" (?

isCallbackEnabled@LUAHandler@@QAE_NH@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 25 error LNK2019: 无法解析的外部符号 "void __cdecl lua_pushlightuserdata(struct lua_State *,void *)" (?lua_pushlightuserdata@@YAXPAUlua_State@@PAX@Z),该符号在函数 "public: void __thiscall LUAHandler::init(class ONScripter *,class ScriptHandler *)" (?init@LUAHandler@@QAEXPAVONScripter@@PAVScriptHandler@@@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 21 error LNK2019: 无法解析的外部符号 "void __cdecl lua_pushnumber(struct lua_State *,double)" (?lua_pushnumber@@YAXPAUlua_State@@N@Z)。该符号在函数 "public: bool __thiscall LUAHandler::isCallbackEnabled(int)" (?isCallbackEnabled@LUAHandler@@QAE_NH@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 23 error LNK2019: 无法解析的外部符号 "void __cdecl lua_pushstring(struct lua_State *,char const *)" (?lua_pushstring@@YAXPAUlua_State@@PBD@Z),该符号在函数 "public: bool __thiscall LUAHandler::isCallbackEnabled(int)" (?isCallbackEnabled@LUAHandler@@QAE_NH@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 16 error LNK2019: 无法解析的外部符号 "void __cdecl lua_pushvalue(struct lua_State *,int)" (?

lua_pushvalue@@YAXPAUlua_State@@H@Z)。该符号在函数 "public: void __thiscall LUAHandler::init(class ONScripter *,class ScriptHandler *)" (?init@LUAHandler@@QAEXPAVONScripter@@PAVScriptHandler@@@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 27 error LNK2019: 无法解析的外部符号 "void __cdecl lua_setfield(struct lua_State *,int,char const *)" (?

lua_setfield@@YAXPAUlua_State@@HPBD@Z),该符号在函数 "public: void __thiscall LUAHandler::init(class ONScripter *,class ScriptHandler *)" (?

init@LUAHandler@@QAEXPAVONScripter@@PAVScriptHandler@@@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 30 error LNK2019: 无法解析的外部符号 "void __cdecl luaL_openlibs(struct lua_State *)" (?luaL_openlibs@@YAXPAUlua_State@@@Z)。该符号在函数 "public: void __thiscall LUAHandler::init(class ONScripter *,class ScriptHandler *)" (?

init@LUAHandler@@QAEXPAVONScripter@@PAVScriptHandler@@@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 31 error LNK2019: 无法解析的外部符号 "void __cdecl luaL_register(struct lua_State *,char const *,struct luaL_Reg const *)" (?luaL_register@@YAXPAUlua_State@@PBDPBUluaL_Reg@@@Z)。该符号在函数 "public: void __thiscall LUAHandler::init(class ONScripter *,class ScriptHandler *)" (?init@LUAHandler@@QAEXPAVONScripter@@PAVScriptHandler@@@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter 错误 20 error LNK2019: 无法解析的外部符号 "void const * __cdecl lua_topointer(struct lua_State *,int)" (?lua_topointer@@YAPBXPAUlua_State@@H@Z),该符号在函数 "public: bool __thiscall LUAHandler::isCallbackEnabled(int)" (?isCallbackEnabled@LUAHandler@@QAE_NH@Z) 中被引用 C:\Users\luozhuang\Desktop\onscripter-20120416VC\LUAHandler.obj onscripter

解决方法:由于是C++项目。EXE引用的lua头文件必须这样写:

extern "C" {
#include <lua.h>
}
extern "C" {
#include <lualib.h>
#include <lauxlib.h>
}

转载于:https://www.cnblogs.com/jzdwajue/p/7258282.html

VC++编译lua库 无法解析lua符号问题相关推荐

  1. lua学习01:c调用lua、lua调用c、lua的协程、lua的常见API、lua读取配置文件总结

    文章目录 1.c通过虚拟机和虚拟栈调用lua test-vm.c test-vm.lua 打印效果 2.lua通过虚拟机和虚拟栈调用c lua-tbl.c test-tbl.lua 3.lua的协程 ...

  2. C++ Lua库 源码编译及使用(VS2019)

    源码编译 官网下载源码: Lua: download 新建 空白解决方案 在该解决方案下新建空项目 lualib(编译静态库) 在该解决方案下新建空项目 luadll(编译动态库) 在该解决方案下新建 ...

  3. vs2008编译中文变量名的lua解释器环境

    0.下载llex.c(此文件是解析变量名的)当然可以自己根据网上的资料改,我是从CSDN下载的一个包里取出来的[当然也可以直接照第3步的方法编译此包,也可以编译成功,之前直接运行包中的lua.exe老 ...

  4. lua(1):lua,luarocks介绍及lua库安装

    先说安装,然后在BB几大组建,目前除了tolua和wxlua用过外其他没用过: 一:安装: Linux下安装方法:借助luarocks安装工具 方法1: 1. 安装lua运行环境:$sudo apt- ...

  5. 在windows程序中嵌入Lua脚本引擎--编写自己的Lua库

    在<在windows程序中嵌入Lua脚本引擎--建立一个简易的"云命令"执行的系统>一文中,我提到了使用Lua的ffi库,可以让我们像写C代码一样写lua程序.这是个非 ...

  6. 最好用的嵌入式网络C库、Lua库

    为什么80%的码农都做不了架构师?>>>    最好用的嵌入式网络C库.Lua库 Evmongoose是一个异步的.基于事件框架(libev)的集成多种协议的嵌入式网络库,包括:TC ...

  7. 合宙lua库详解-sys

    文章目录 简介 QUESTION START sys.init(0,0) sys.run lua内部消息机制 publish subscribe waitUntil dispatch 定时器的实现 * ...

  8. 合宙lua库详解-ril

    简介 肝了这么久的讲解,一个评论和点赞都没有,没有一丝丝反馈,没有一丝丝赞扬.难受哦!!! 但是我还得肝,必须肝出一个赞. 如果大家能给点反馈,给点一键三连,我肝的更起劲.大家的评价是我前进最大的鼓舞 ...

  9. php vs lua,解析LUA与PHP在WEB应用的性能对比

    解析LUA与PHP在WEB应用的性能对比是本文要介绍的内容,这几天用在WEB开发的LUA框架已经完成,框架中已包括数据库操作和模板操作的功能,能够很简单方便的应用在WEB开发上.在此时我对这个LUA框 ...

最新文章

  1. logging 模块记录日志
  2. 时间序列数据和MongoDB:第三部分 - 查询,分析和呈现时间序列数据
  3. 「Smile」一下,轻松用Java玩转机器学习
  4. python 机器学习 爬取关键字_5行Python就能爬取 3000+ 上市公司的信息?
  5. C++ bitset的用法
  6. 方法有多少个参数才算多?
  7. 【Ant Design Vue】之layout布局
  8. 工具箱锁打不开了怎么办_木门门锁坏了怎么办?维修小技巧在手不发愁
  9. c# 多线程界面卡顿_C#多线程解决界面卡死问题的完美解决方案
  10. 基于单片机的电子密码锁的实现
  11. 在线浏览 Stata 15 PDF 全套电子手册
  12. 思科模拟器5506防火墙配置_企业办公网络配置不求人之二
  13. [单片机框架][DFU] Dfu升级例子 带crc校验+超时机制+led指示灯+芯片加锁+芯片自擦
  14. cmd看excel有多少个子表_excel表格拆分成多个表格方法工具
  15. 腾讯云学生服务器入口地址(腾讯云​学生机官网)
  16. Add Python Interpreter 报错 Error code:2. XX can‘t open file XX [Errno 2] No such file or directory
  17. win2003系统服务器搭建,最新版WIN2003系统服务器环境搭建教程.doc
  18. 自动驾驶Apollo安装步骤
  19. 三顾人才和拉勾网哪家好
  20. centos7 /grub2/i386-pc/normal.mod not found 修复log

热门文章

  1. 医疗数字化:区块链或成最强辅助
  2. 外挂技术汇总及书籍推荐
  3. Github 之删除文件或者文件夹(不影响本地文件,只删除远端的指定文件或者文件夹) 操作
  4. Centos7运行Docker1.13.1报错Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor pres
  5. matlab仿真及分析,CSMACD性能分析及MATLAB仿真.pdf
  6. win10 操作中心是灰色无法选择 终极解决方法
  7. 网站首页js幻灯片代码
  8. Android 分析ANR和死锁(1)
  9. 网页显示自动日期(自动更新)
  10. House MD S4:Memorable quips