English 中文(简体)
Can t Building lua a Project with lua in VS2010, Library issue accused
原标题:Can t build lua a project with lua in VS2010, library issue suspected
  • 时间:2011-08-01 19:57:06
  •  标签:
  • lua

I m trying to setup a c++ console application with lua. For whatever reason, I can t get it to build. I think it is some issue with the .lib file.

我发现的错误是:

1>------ Build started: Project: testLua, Configuration: Debug Win32 ------
1>  testLua.cpp
1>testLua.obj : error LNK2019: unresolved external symbol _luaL_newstate referenced in function _wmain
1>C:UsersBMillekDesktopTestLua	estLuaDebug	estLua.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

这里,我的主要工作是:

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



lua_State* L;
int _tmain(int argc, _TCHAR* argv[])
{
    L = lua_open();

    while(true)
    ;
return 0;
}

I did not compile lua myself. I got lua5_1_4_Win64_vc10_lib.zip off of SourceForge. I am running Windows 7, 64 bit.

For Linker->Input I have lua5.1.lib

For VC ++ Directores->Include Directories I have C:Program Fileslua5.1include

For VC ++ Reference Directories, Library Directories I have C:Program Fileslua5.1

试图将校正改写为无效档案名称,给我留下了一个错误,因此,我认为这是看到的。

我的数字必须是我失踪的,但我不知道什么。 任何想法?

问题回答

您在使用Lua语时,必须界定LUA_BUILD_AS_DL。 具体做法是:财产组合;C/C++->Preprocessor->Preprocessor Defines。





相关问题
Wrapping a Lua object for use in C++ with SWIG

Currently I know how to have C++ objects instantiated and passed around in Lua using SWIG bindings, what I need is the reverse. I am using Lua & C++ & SWIG. I have interfaces in C++ and ...

Can t lua_resume after async_wait?

I have some lua script that have some long running task like getting a web page so I make it yield then the C code handle get page job async, so the thread free to do other job and after a specify ...

How to remove a lua table entry by its key?

I have a lua table that I use as a hashmap, ie with string keys : local map = { foo = 1, bar = 2 } I would like to "pop" an element of this table identified by its key. There is a table.remove() ...

Lua plain string.gsub

I ve hit s small block with string parsing. I have a string like: footage/down/temp/cars_[100]_upper/cars_[100]_upper.exr and I m having difficulty using gsub to delete a portion of the string. ...

why do i get "attempt to call global require (a nil value)"?

I have 3 lua files, Init.lua, FreeCamera.lua and Camera.lua , init.lua calls require "Core.Camera.FreeCamera" Free Camera: module(...) require "Core.Camera.Camera" local M = {} FreeCamera = M M ...

热门标签