0

I have installed the IUP GUI for Lua (https://www.tecgraf.puc-rio.br/iup/, the website is in English, although it doesn't look like it). I have tried running IUP on my computer using their tutorial code:

require("iuplua")

iup.Message("Hello World 1","Hello world from IUP.")

-- to be able to run this script inside another context

if (iup.MainLoopLevel()==0) then

iup.MainLoop()

iup.Close()

end

but whenever I do I get this error: module 'iuplua' not found and then I get a bunch of other errors below that :

no field package.preload['iuplua']

no file '.\iuplua.lua'
no file 'C:\Users\user\bin\lua\iuplua.lua'
no file 'C:\Users\user\bin\lua\iuplua\init.lua'
no file './iuplua.lua'
no file './iuplua/init.lua'
no file './lua/iuplua.lua'
no file './lua/iuplua/init.lua'
no file 'C:\Users\user\lualibs/iuplua/iuplua.lua'
no file 'C:\Users\user\lualibs/iuplua.lua'
no file 'C:\Users\user\lualibs/iuplua/iuplua/init.lua'
no file 'C:\Users\user\lualibs/iuplua/init.lua'
no file '.\iuplua.dll'
no file 'C:\Users\user\bin\iuplua.dll'
no file 'C:\Users\user\bin\loadall.dll'
no file 'C:\Users\user\bin/clibs/iuplua.dll

This occurs even if I put the file I'm running into the srclua5 folder which contains a file called "iuplua.lua". Why does this occur? Could someone please help?

Robert
  • 2,711
  • 7
  • 15
Stacky
  • 1
  • 1
  • Why `iuplua.lua`? UIP is a library written on C, it does not have `iuplua.lua`, it has `iuplua.dll` instead. You should put `iuplua.dll` in the current directory. You should not have file `iuplua.lua` at all. If it is your own file, rename it. – Egor Skriptunoff Jun 20 '22 at 09:04
  • @EgorSkriptunoff I downloaded the IUP library directly from their SourceForge. I did not make the 'iuplua.lua' file. There are only 5 files called iuplua. They're 'iuplua.lua' , 'iuplua.vcxproj' , 'iuplua.lh' , 'iuplua.def' and an 'iuplua.c'. The 'iuplua.c' is in the same 'srclua5' folder as 'iuplua.lua' – Stacky Jun 20 '22 at 17:05
  • There are no dll files in the whole iup library. – Stacky Jun 20 '22 at 17:11
  • How have you installed IUP? Which compiler have you used? Ready-to-use DLLs are [here](https://sourceforge.net/projects/iup/files/3.30/Windows%20Libraries/Dynamic/) – Egor Skriptunoff Jun 20 '22 at 18:55
  • @EgorSkriptunoff I downloaded from that link, first I downloaded the main iup3.30_sources.zip and then then the win64_dll16 folder – Stacky Jun 22 '22 at 15:14
  • Have you found dll ? – Egor Skriptunoff Jun 22 '22 at 17:06
  • @EgorSkriptunoff I have found multiple .dll files but none of them are called iuplua.dll or loadall.dll – Stacky Jun 22 '22 at 23:08
  • If your Lua version is Lua 5.4 then you need `iuplua54.dll` from `iup-3.30-Lua54_Win64_dllw6_lib` archive. Use `require('iuplua54')` – Egor Skriptunoff Jun 23 '22 at 07:38
  • @EgorSkriptunoff There is no such thing as iuplua54.dll – Stacky Jun 27 '22 at 13:14
  • https://sourceforge.net/projects/iup/files/3.30/Windows%20Libraries/Dynamic/Lua54/iup-3.30-Lua54_Win64_dllw6_lib.zip/download – Egor Skriptunoff Jun 27 '22 at 13:54
  • @EgorSkriptunoff I have been away for around 1.5 weeks time, I'm back now. Thank you for all your help. I extracted the files and put them in my bin folder, when I did so I received a new error "%1 is not a valid Win32 application". I believe this might be because I am using ZeroBrane Studios which does not use Lua 5.4. I will install lua 5.4 and try this when I can do so. – Stacky Jul 07 '22 at 19:46
  • `"%1 is not a valid Win32 application"` - is it a zerobrain error? You should create another question about the zerobrain problem. – Egor Skriptunoff Jul 07 '22 at 23:27
  • @EgorSkriptunoff It's not exclusive to Zerobrane, it's a windows error that I believe may be happening because my computer is not using lua 5.4. I'm running into some problems getting lua 54 to work though because when I try running it using cmd, it gives me an error that lua51.dll is not found despite the fact that I have just installed lua54 binaries so I will try to work through that and see. I have added a path to Lua54.dll so Im not sure why it still wants lua51.dll though. – Stacky Jul 09 '22 at 18:23
  • So, your question is "how to setup zerobrain to work with lua 5.4". It is not iup-related. – Egor Skriptunoff Jul 09 '22 at 19:01
  • @EgorSkriptunoff I got it to work with lua54 and it gave an error again: – Stacky Jul 15 '22 at 02:59
  • lua54: error loading module 'iuplua54' from file 'C:\Users\Stacky\bin\iuplua54.dll': The specified module could not be found. stack traceback: [C]: in ? [C]: in function 'require' tester.lua:1: in main chunk [C]: in ? – Stacky Jul 15 '22 at 03:00
  • I think this may be a problem with iuplua module itself at this point – Stacky Jul 15 '22 at 03:04
  • May be bitness (32/64) of DLL and EXE does not match? – Egor Skriptunoff Jul 15 '22 at 05:50
  • @EgorSkriptunoff How would I check the bitness? – Stacky Jul 15 '22 at 16:01
  • Dependency Walker – Egor Skriptunoff Jul 15 '22 at 20:24
  • @EgorSkriptunoff Sorry for the delay, they are both 64-bit files. – Stacky Jul 23 '22 at 20:47

0 Answers0