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.

3
  • 2
    Use package.cpath for loading shared libraries. See the manual Commented Jan 31, 2016 at 5:26
  • 1
    Also, this answer might be of some help. Commented Jan 31, 2016 at 5:32
  • @Adam yep, that's work. Commented Jan 31, 2016 at 5:42

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.