2
a = ";E:\\Code\\Lua\\FakeMagic\\testingarea\\test\\libs\\?.dll"
package.path = package.path .. a
midi = require "luamidi"

I got:

E:\Soft\lua\5.1\lua.exe: error loading module 'luamidi' from file 'E:\Code\Lua\FakeMagic\testingarea\test\libs\luamidi.dll':
        E:\Code\Lua\FakeMagic\testingarea\test\libs\luamidi.dll:1: '=' expected near 'Р'
stack traceback:
        [C]: ?
        [C]: in function 'require'
        E:\Code\Lua\FakeMagic\testingarea\test\midi.lua:2: in main chunk
        [C]: ?

But when luamidi.dll at the same directory with the lua file all is ok.
P.S The path is correct.

Parki
  • 159
  • 9
  • 2
    Use `package.cpath` for loading shared libraries. See the [manual](http://www.lua.org/manual/5.3/manual.html#pdf-package.cpath) – Adam Jan 31 '16 at 05:26
  • 1
    Also, [this answer](https://stackoverflow.com/questions/10356709/installing-lua-socket-library/10358900#10358900) might be of some help. – Adam Jan 31 '16 at 05:32
  • @Adam yep, that's work. – Parki Jan 31 '16 at 05:42

1 Answers1

3

Lua's path list for DLL/SO files is different from its path list for .lua scripts. The DLL/SO path list is stored in package.cpath.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982