golua
golua copied to clipboard
Dynamic loading not supported when trying to require("module.so")
Hello @aarzilli
Thanks a lot for your work to create a go binding for lua C APIs.
Environment:
- Golang: 1.20
- Lua: 5.4.6
- golua: last version
I am building a static go binary with the following command:
go build -ldflags '-extldflags "-static"' -tags "luaa lua54 yara_static" -o app main.go
Compilation works fine, except that when my Lua file try to require a module (require 'rapidjson' that I installed via luarocks, it fails with: `error loading module 'rapidjson' from file '/where/lib/was/built/rapidjson.so':\n\tDynamic loading not supported".
Do you know why this is failing ?
Cheers.
Try removing the -static flag.
That actually worked, thank you @aarzilli .