2

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.

NetherGranite
  • 1,940
  • 1
  • 14
  • 42

1 Answers1

5

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.

lhf
  • 70,581
  • 9
  • 108
  • 149
  • 1
    I suspected that Lua might be trying to parse it like a Lua file, but I wasn't sure what could possibly be causing it. Nice catch. – NetherGranite Oct 09 '18 at 10:20