Skip to content

package.loadlib failed: dynamic libraries not enabled #2

@aa2013

Description

@aa2013

I compiled cjson. so myself and put it in the app's private path. Use the following code to load the library

_lua.run('package.cpath = package.cpath .. ";/data/data/${Constants.appPkg}/app_so/?.so"')

Then load it in Lua

local f, err = package.loadlib(
              "/data/data/top.coclyun.clipshare/app_so/cjson.so",
              "luaopen_cjson"
)
print(f, err)

Outputs:

nil	dynamic libraries not enabled; check your Lua installation

Can't load the library? Or is there an error in the SO file I compiled?

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