I'm trying to use gcc to dynamically link to the lua library but I keep getting undefined references to every single lua function, including luaL_newstate.
Here's the code I'm trying to compile
#include <stdlib.h>
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
int main(void)
{
lua_State *state = luaL_newstate();
lua_close(state);
return 0;
}
And here's the command I'm using
cls && gcc test.c -Ilua-5.4.2_Win64_dllw6_lib\include -Llua-5.4.2_Win64_dllw6_lib -llua54
I also tried static linking with -l:liblua54.a
, changing the order of the parameters, and moving the files into the mingw64 include and lib folders and using those instead, but nothing seems to change anything.