<tfoot id='JwH6F'></tfoot>

    <legend id='JwH6F'><style id='JwH6F'><dir id='JwH6F'><q id='JwH6F'></q></dir></style></legend>
  • <small id='JwH6F'></small><noframes id='JwH6F'>

      <i id='JwH6F'><tr id='JwH6F'><dt id='JwH6F'><q id='JwH6F'><span id='JwH6F'><b id='JwH6F'><form id='JwH6F'><ins id='JwH6F'></ins><ul id='JwH6F'></ul><sub id='JwH6F'></sub></form><legend id='JwH6F'></legend><bdo id='JwH6F'><pre id='JwH6F'><center id='JwH6F'></center></pre></bdo></b><th id='JwH6F'></th></span></q></dt></tr></i><div id='JwH6F'><tfoot id='JwH6F'></tfoot><dl id='JwH6F'><fieldset id='JwH6F'></fieldset></dl></div>

        <bdo id='JwH6F'></bdo><ul id='JwH6F'></ul>

        “未定义的引用"使用 Lua

        quot;Undefined reference toquot; using Lua(“未定义的引用使用 Lua)

              <tbody id='7nz0C'></tbody>

                  <bdo id='7nz0C'></bdo><ul id='7nz0C'></ul>
                • <tfoot id='7nz0C'></tfoot>

                  <small id='7nz0C'></small><noframes id='7nz0C'>

                • <i id='7nz0C'><tr id='7nz0C'><dt id='7nz0C'><q id='7nz0C'><span id='7nz0C'><b id='7nz0C'><form id='7nz0C'><ins id='7nz0C'></ins><ul id='7nz0C'></ul><sub id='7nz0C'></sub></form><legend id='7nz0C'></legend><bdo id='7nz0C'><pre id='7nz0C'><center id='7nz0C'></center></pre></bdo></b><th id='7nz0C'></th></span></q></dt></tr></i><div id='7nz0C'><tfoot id='7nz0C'></tfoot><dl id='7nz0C'><fieldset id='7nz0C'></fieldset></dl></div>

                  <legend id='7nz0C'><style id='7nz0C'><dir id='7nz0C'><q id='7nz0C'></q></dir></style></legend>
                  本文介绍了“未定义的引用"使用 Lua的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在尝试构建我的项目时收到错误 undefined reference to 'luaL_newstate'.我知道这是链接器的错误,但我对 Lua 比较陌生,并向项目添加了一个库.顺便说一下,我使用 Code::Blocks.API函数luaL_openlibsluaL_loadfilelua_pcalllua_getfieldlua_typelua_settop 也不见了.

                  I got the error undefined reference to 'luaL_newstate' when I try to build my project. I know it's an error with the linker but I'm relatively new to Lua and adding a library to a project. I use Code::Blocks by the way. API functions luaL_openlibs, luaL_loadfile, lua_pcall, lua_getfield, lua_type, lua_settop are missing too.

                  我在一个网站上看到我必须将我的项目与 libdl 链接才能解决这个问题,但我真的不知道这是什么意思以及如何去做.

                  I saw on a webite that I have to link my project with libdl in order to solve this problem, but I don't really know what it mean and how to do it.

                  推荐答案

                  我遇到了同样的问题,就我而言,我找到了一个对我有用的解决方案 此处.基本上包括将 lua 的 #include 包裹在 extern "C" 中,例如:

                  I faced the same problem, in my case I found a solution that worked for me here. Basically consist in wrapping the #include s of lua inside a extern "C", like:

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

                  这篇关于“未定义的引用"使用 Lua的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Constructor initialization Vs assignment(构造函数初始化 Vs 赋值)
                  Is a `=default` move constructor equivalent to a member-wise move constructor?(`=default` 移动构造函数是否等同于成员移动构造函数?)
                  Has the new C++11 member initialization feature at declaration made initialization lists obsolete?(声明时新的 C++11 成员初始化功能是否使初始化列表过时了?)
                  Order of constructor call in virtual inheritance(虚继承中构造函数调用的顺序)
                  How to use sfinae for selecting constructors?(如何使用 sfinae 选择构造函数?)
                  Initializing a union with a non-trivial constructor(使用非平凡的构造函数初始化联合)
                    <legend id='hxrKa'><style id='hxrKa'><dir id='hxrKa'><q id='hxrKa'></q></dir></style></legend>

                    <small id='hxrKa'></small><noframes id='hxrKa'>

                      <bdo id='hxrKa'></bdo><ul id='hxrKa'></ul>

                          1. <tfoot id='hxrKa'></tfoot>
                              <tbody id='hxrKa'></tbody>
                            <i id='hxrKa'><tr id='hxrKa'><dt id='hxrKa'><q id='hxrKa'><span id='hxrKa'><b id='hxrKa'><form id='hxrKa'><ins id='hxrKa'></ins><ul id='hxrKa'></ul><sub id='hxrKa'></sub></form><legend id='hxrKa'></legend><bdo id='hxrKa'><pre id='hxrKa'><center id='hxrKa'></center></pre></bdo></b><th id='hxrKa'></th></span></q></dt></tr></i><div id='hxrKa'><tfoot id='hxrKa'></tfoot><dl id='hxrKa'><fieldset id='hxrKa'></fieldset></dl></div>