Skip to content

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

Closed

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, 

Activity

  1. Repository owner locked and limited conversation to collaborators on Jun 18, 2023
  2. converted this issue into a discussion #443 on Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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