Srlua - Problem after compiling

Asked

Viewed 229 times

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 execute, always gives the error:

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

Running the script by the Lua interpreter works normally.

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

Package.path 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\5.1\lua\?.luac

  • I downloaded here: http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/#srlua

  • It was 5.1. I think I got it. I’ll see, and create an answer.

  • My mistake, still no solution :\

  • your Windows is x64 or x86?

  • The message you show doesn’t come from Lua.

  • X86. @lhf, you know what can be done?

  • Seems to me a path error. Print package.path before calling require.

  • I edited the question. Hello.

Show 3 more comments

1 answer

1

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

Follow the steps used to compile:

Archives:

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

To compile:

glue srlua.exe test.lua teste.exe

Exit after execution:

C:\tmp\teste-lua>teste
Gabriel

Ambience: Windows 8.1 64bit with the variable PATH pointing to the directory base of the Lua interpreter (the file glue.exe 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.