Skip to content

L.DoFile does not work when i require a so in lua script #439

@littleningmeng

Description

@littleningmeng

I have a lua script a.lua, and in this file I required a Lua so module:

pb = require "pb"
print(pb)

and the pb module is a lua so in the same dir with a.lua
but, when the Golang code below not work

L := lua.NewState()
defer L.Close()
if err := L.DoFile("a.lua"); err != nil {
  panic(err)
}

error message:

panic: <string>:1: module pb not found:
	no field package.preload['pb']
	stat ./pb.lua: no such file or directory
	stat /usr/local/share/lua/5.1/pb.lua: no such file or directory
	stat /usr/local/share/lua/5.1/pb/init.lua: no such file or directory, 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions