I get the following error from require "iuplua"
lua: budgelua5.lua:3: module 'iuplua' not found:
no field package.preload['iuplua']
no file 'z:\Program Files\Lua\5.1\lua\iuplua.lua'
no file 'z:\Program Files\Lua\5.1\lua\iuplua.luac'
no file 'z:\Program Files\Lua\5.1\lib\iuplua.lua'
no file 'iuplua.lua'
no file '.\iuplua.lua'
no file 'z:\Program Files\Lua\5.1\lua\iuplua.lua'
no file 'z:\Program Files\Lua\5.1\lua\iuplua\init.lua'
no file 'z:\Program Files\Lua\5.1\iuplua.lua'
no file 'z:\Program Files\Lua\5.1\iuplua\init.lua'
no file 'z:\Program Files\Lua\5.1\lua\iuplua.luac'
no file 'z:\Program Files\Lua\5.1\lua\iuplua\iuplua.lua'
no file 'z:\Program Files\Lua\5.1\clibs\iuplua.dll'
no file 'iuplua.dll'
no file '.\libiuplua51.dll'
stack traceback:
[C]: in function 'require'
budgelua5.lua:3: in main chunk
[C]: ?
>Exit code: 1
Pretty sure this is a path problem but I don't know how to fix it.
The problem is that iuplua
is really named iuplua51
. The default package.cpath
is usually edited on Windows builds of Lua to include patterns that include ?51
in them to pick up DLLs with Lua version numbers as well as the usual path. For example, my current install of Lua for Windows has the following:
P:\Data\PhotoArchive>lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > print(package.cpath) .\?.dll;.\?51.dll;C:\Program Files\Lua\5.1\?.dll;C:\Program Files\Lua\5.1\?51.dl l;C:\Program Files\Lua\5.1\clibs\?.dll;C:\Program Files\Lua\5.1\clibs\?51.dll;C: \Program Files\Lua\5.1\loadall.dll;C:\Program Files\Lua\5.1\clibs\loadall.dll >
Note that the same thing is not usually done to package.path
since modules written in Lua usually don't have as strong a dependence on the Lua core version, or if they do, they can work around the issues at run time much more easily than modules written in C can.
Also, note that IUP is not yet available to work with the brand new Lua 5.2 release. The team has been at work and will likely have it ported "soon" judging from their recent releases of CD and IM which are now compatible with 5.2.