dllluamultilingualcross-languagelua-5.1

Lua 5.1 dll error: equals sign expected on line 1?


I have the following code:

int luaopen_Library()
{
    return 0;
}

Attempting to call require "Library" throws the following error:

Library.dll:1: '=' expected

How can I fix this? Please let me know if more information is needed; I am new to working with dlls.


Solution

  • The message is telling you that Lua is trying to load the dll as a Lua program. You have probably put the dll in the path given by LUA_PATH. You need to move it to the path given by LUA_CPATH.