SrLua - Problem after compiling

4

I'm trying to compile a simple script that contains:

require 'classlib'
human = class()

function human:__init(name)
    self.name = name
end
gabriel = human("Gabriel")
print(gabriel.name)

With srlua, but after compiling, when I try to run, it always gives the error:

  

1: Could not load package 'classlib' from path ';; C: \ Program Files \ Lua \ 5.1 \ moon \. luac

Running the script through the Lua interpreter, it works normally.

Note: all files are in the same folder (srlua, test.lua, classlib.lua)

  

Package.path: ;.\?.lua;G:\PROGRAMACAO\srlua\lua\?.lua;G:\PROGRAMACAO\srlua\lua\?\init.lua;G:\PROGRAMACAO\srlua\?.lua;G:\PROGRAMACAO\srlua\?\init.lua;C:\Program Files\Lua.1\lua\?.luac

    
asked by anonymous 28.12.2014 / 15:38

1 answer

1

I tested the program with the versions: moon-5.3.2 , srlua-5.3.2 , classlib 2.04.04 ; and there were no errors.

Follow the steps used to compile:

Files:

C:\tmp\teste-lua>dir /b
classlib.lua
srlua.exe
test.lua

To compile:

glue srlua.exe test.lua teste.exe

Output after execution:

C:\tmp\teste-lua>teste
Gabriel

Environment: Windows 8.1 64bit with variable PATH pointing to directory base of the Lua interpreter (the glue.exe file was placed in the same directory).

Because they are newer versions than the ones used in the question, maybe this error has occurred due to a bug that has already been fixed.

    
28.02.2016 / 09:25