How to run LUA project with IUP package in ZeroBrane Studio?

342 Views Asked by At

I have this problem starting/debugging a project in ZeroBrane Studio. I have all source files.

Using a command in cmd.exe:

lib\lua52.exe OmapTest2.lua

starts the project, but I want to debug the project. When I execute the OmapTest2.lua in ZBS it gives me this .. error(?):

Program starting as '"C:\ZeroBraneStudio\bin\lua52.exe" -e "io.stdout:setvbuf('no')" "C:\ZeroBraneStudio\cfg\user.lua"'.
Program 'lua52.exe' started in 'C:\Radek\Tester' (pid: 9804).
C:\ZeroBraneStudio\bin\lua52.exe: C:\ZeroBraneStudio\bin\lua\iuplua.lua:6: attempt to index global 'iup' (a nil value)
stack traceback:
    C:\ZeroBraneStudio\bin\lua\iuplua.lua:6: in main chunk
    [C]: in function 'require'
    C:\ZeroBraneStudio\cfg\user.lua:1: in main chunk
    [C]: in ?
Program completed in 1.53 seconds (pid: 9804).

No idea what might be wrong. What I did is:

What should I do? Thanks in advance.

1

There are 1 best solutions below

9
Antonio Scuri On

Copy pure C DLLs, like iup.dll to \ZeroBraneStudio\bin

Copy Lua modules DLLs, like iuplua52.dll to \ZeroBraneStudio\bin\clibs52

ZeroBrane Studio uses generic Lua DLLs that don't have the necessary suffix for IupLua in LUA_CPATH. So you need to manually add it. Edit the package.cpath at the beginning of your script:

package.cpath = package.cpath .. ";C:/ZeroBraneStudio/bin/clibs52/?52.dll"