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

Compile C++ works, but runtime linkage error #1750

No3x opened this issue May 13, 2019 · 1 comment


None yet
1 participant
Copy link

commented May 13, 2019

  • Node Version: v11.6.0
  • Platform: Darwin dhcp-vl203 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 21 20:07:40 PDT 2018; root:xnu-3248.73.11~1/RELEASE_X86_64 x86_64
  • Compiler: Apple LLVM version 8.0.0 (clang-800.0.42.1)
    Target: x86_64-apple-darwin15.6.0
    Thread model: posix
    InstalledDir: /Applications/
  • Module: own
Verbose output (from npm or node-gyp):
/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js run dev --scripts-prepend-node-path=auto

> robot@1.0.0 dev /Users/myuser/IdeaProjects/Javascript/issue-node-gyp-cpp-mixed
> node-gyp rebuild && node test/testmodule.js

  CC(target) Release/
  LIBTOOL-STATIC Release/nothing.a
  CXX(target) Release/
  CXX(target) Release/
  SOLINK_MODULE(target) Release/robot.node
dyld: lazy symbol binding failed: Symbol not found: __ZN7MyClassC1Ed
  Referenced from: /Users/myuser/IdeaProjects/Javascript/issue-node-gyp-cpp-mixed/build/Release/robot.node
  Expected in: flat namespace

dyld: Symbol not found: __ZN7MyClassC1Ed
  Referenced from: /Users/myuser/IdeaProjects/Javascript/issue-node-gyp-cpp-mixed/build/Release/robot.node
  Expected in: flat namespace

sh: line 1: 52731 Trace/BPT trap: 5       node test/testmodule.js
npm ERR! errno 133
npm ERR! robot@1.0.0 dev: `node-gyp rebuild && node test/testmodule.js`
npm ERR! Exit status 133
npm ERR! 
npm ERR! Failed at the robot@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/myuser/.npm/_logs/2019-05-13T09_22_30_023Z-debug.log

Process finished with exit code 133 (interrupted by signal 5: SIGTRAP)

I want to write a simple wrapper for a C++ project but get a runtime linkage error. I have created a minimal example.
Steps to reproduce:
npm i
npm run dev (builds and calls binding from js)

The problem occurs as soon as I start to use C++ classes. Can't I use C++ features?


This comment has been minimized.

Copy link

commented May 14, 2019

Closed. Rather an issue with my configuration than with the module.

@No3x No3x closed this May 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.