你如何在OOLUA中运行lua脚本?我的C Project目录中有一个名为“script.lua”的脚本,我尝试这样做:
#include <OOLUA/oolua.h>
...
void Game::init() {
OOLUA::Script vm;
vm.run_file("Scripts/script.lua");
}
我的script.lua看起来像这样:
print("Output From Lua Script!")
我已经构建并链接到oolua.lib,每当我运行我的项目时,我都会收到以下错误:
1> Game.obj:错误LNK2019:未解析的外部符号“public:__thiscall OOLUA :: Script :: Script(void)”(?? 0Script @ OOLUA @@ QAE @ XZ)在函数“public:thiscall Game :: Game”中引用(void)“(?? 0Game @@ QAE @XZ)1> Game.obj:错误LNK2019:未解析的外部符号”public: thiscall OOLUA :: Script ::〜Script(void)“(?? 1Script @ OOLUA @@ QAE @ XZ)函数__unwindfunclet $ ?? 0Game @@ QAE @XZ $ 1 1> Game.obj:错误LNK2019:未解析的外部符号“public:bool __thiscall OOLUA :: Script :: run_file(class std :: basic_string,class std :: allocator> const&)“(?run_file @ Script @ OOLUA @@ QAE_NABV?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ std @@@ Z)引用在函数“private:void __thiscall Game :: init(void)”(?init @ Game @@ AAEXXZ)
我这样做完全错了吗?