I've had a similar problem with C++ addons. In one instance I had to change libraries ('iltorb' compression library) and in the other I had to use emscripten to transpile the C++ code into javascript so the V8 engine could use directly. It doesn't feel like a solution as much as a workaround, but it does work.
Mikkel Oblivious.io <https://www.oblivious.io/?r=googlenodejs> On Wednesday, January 9, 2019 at 7:48:04 AM UTC-8, Vicent Vidal wrote: > > Recently I developed my first native C++ Addon for node that works fine > with my node project (node version 10.15.0) > The Addon has been built using XCode, which project has been generating > using CMake. > > I´m having the following error when I use the very same native C++ addon > from my Electron app. > > *dyld: lazy symbol binding failed: Symbol not found: > __ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE* > * Referenced from: > /Users/vicentvidal/Documents/Desarrollo/DASNet2/dasaudio/build/DASNetAddon.node* > * Expected in: flat namespace* > *dyld: Symbol not found: > __ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE* > * Referenced from: > /Users/vicentvidal/Documents/Desarrollo/DASNet2/dasaudio/build/DASNetAddon.node* > * Expected in: flat namespace* > > > > As I can see the problem appears just when I call from my Electron App > > *const addon = require('bindings')('DASNetAddon');* > > > which call the following C++ code > > * static NAN_MODULE_INIT(Init) {* > * v8::Local<v8::FunctionTemplate> tpl = > Nan::New<v8::FunctionTemplate>(New);* > * tpl->SetClassName(Nan::New("StreamingWorker").ToLocalChecked());* > * tpl->InstanceTemplate()->SetInternalFieldCount(2);* > > * SetPrototypeMethod(tpl, "sendToAddon", sendToAddon);* > > * constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked());* > * Nan::Set(target, Nan::New("StreamingWorker").ToLocalChecked(),* > * Nan::GetFunction(tpl).ToLocalChecked());* > * }* > > My Electron version is 3.0.10 > My Nan version 2.12.1 > My bindings version 1.3.1 > > Does anybody has any suggestion? > > Thank you in advance > > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/bf7fd19c-6872-4df1-9bc3-bcad18f023aa%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.