Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking Lua #1544

Closed
JlnWntr opened this issue Sep 16, 2018 · 3 comments
Closed

Linking Lua #1544

JlnWntr opened this issue Sep 16, 2018 · 3 comments

Comments

@JlnWntr
Copy link

JlnWntr commented Sep 16, 2018

I've downloaded and installed Lua like explained here: https://www.lua.org/download.html

Now I try to use Lua in the C++ code for my nodejs addon. This is my binding.gyp file:

  "targets": [
    {
      "target_name": "lua",
      "sources": [ "lua.cpp" ],

        "libraries": [
          "-ldl",
          "-llua",
        ],

      "cflags_cc": [
        "-std=c++17", "-fconcepts",
      ]
    }
  ]
}

This is not working. I always get this error:

/usr/bin/ld: //usr/local/lib/liblua.a(lapi.o): relocation of
//usr/local/lib/liblua.a: error adding symbols: undefined vlaue
collect2: error: ld returned 1 exit status
make: *** [Release/obj.target/lua.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:262:23)
...

I definitely can compile any c++-code with llua on my system like this:

g++-8 lua_app.cpp -std=c++17 -llua -ldl -Wall -fconcepts

What am I doing wrong with node-gyp?

@rvagg
Copy link
Member

rvagg commented Jun 20, 2019

@creationix you don't happen to have a lua-embedded-in-a-node-addon binding.gyp example handy do you?
closing this issue due to staleness.

@rvagg rvagg closed this as completed Jun 20, 2019
@JlnWntr
Copy link
Author

JlnWntr commented Jul 4, 2019

Well, this issue is not resolved yet.

@creationix
Copy link

I do not, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants