简体   繁体   中英

lua 5.2.1 unresolved externals

I'm using visual studio 2012 and when I try to compile, I get following errors:

Error   7   error LNK1120: 6 unresolved externals   C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\Release\LuaTest.exe   LuaTest
Error   4   error LNK2001: unresolved external symbol _lua_close    C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj  LuaTest
Error   5   error LNK2001: unresolved external symbol _lua_pcallk   C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj  LuaTest
Error   6   error LNK2001: unresolved external symbol _lua_settop   C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj  LuaTest
Error   2   error LNK2001: unresolved external symbol _luaL_loadfilex   C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj  LuaTest
Error   1   error LNK2001: unresolved external symbol _luaL_newstate C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj LuaTest
Error   3   error LNK2001: unresolved external symbol _luaopen_base C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj  LuaTest

Source code taken from HERE .

Using following library version: lua-5.2.1_Win32_dll10_lib.zip

I tried different lua52.lib files, but with all of them I get these errors. What could be wrong?

You are using Visual Studio 2012, but library files from here appealingly only support up to Visual Studio 2010.

Anyway, Lua is small and very easy to compile. I would really recommend you to include Lua source files in Visual Studio instead of libraries.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM