Skip to content

package.loadlib failed: dynamic libraries not enabled #2

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?

Activity

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