简体   繁体   中英

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

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.

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM