0

I'm trying to create a new project using lua library. So far, I've always used NuGet Lua for this, but now it suddenly stopped working. All my code is this:

#include <iostream>
#include <lua.h>
#include <lauxlib.h>

int main()
{
    luaL_newstate();
    return 0;
}

And I'm getting this error: error LNK2019: unresolved external symbol "__declspec(dllimport) struct lua_State * __cdecl luaL_newstate(void)" (__imp_?luaL_newstate@@YAPAUlua_State@@XZ) called in function _main

I know LNK2019 is usually a problem with linking, but it was usually done by Nuget package. I also tried manually linking against lua.lib in package directory, but it also did not work.

How do I solve this?

Sherlock Holmes
  • 191
  • 1
  • 8
  • 2
  • @Egor Skriptunoff How is a linker error solved by a simple header file? What dark magic did you use? – Sherlock Holmes May 27 '21 at 08:31
  • 2
    Does this answer your question? [LUA compile error with Visual 2010 "external symbol "struct lua\_State \* \_\_cdecl luaL\_newstate(void)"](https://stackoverflow.com/questions/22813642/lua-compile-error-with-visual-2010-external-symbol-struct-lua-state-cdecl) that's like the first hit when you google that error message... also read https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix – Piglet May 27 '21 at 11:16

0 Answers0