Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I bundle zeromq with an electron app?

Introducing zmq into my Electron app has proved to be onerous:

01:33:03 {master %=} rgbkrk@puter ~/code/jupyter-sidecar$ electron .
dyld: lazy symbol binding failed: Symbol not found: __ZN2v89Signature3NewEPNS_7IsolateENS_6HandleINS_16FunctionTemplateEEEiPS5_
  Referenced from: /Users/rgbkrk/code/jupyter-sidecar/node_modules/zmq/build/Release/zmq.node
  Expected in: dynamic lookup

dyld: Symbol not found: __ZN2v89Signature3NewEPNS_7IsolateENS_6HandleINS_16FunctionTemplateEEEiPS5_
  Referenced from: /Users/rgbkrk/code/jupyter-sidecar/node_modules/zmq/build/Release/zmq.node
  Expected in: dynamic lookup

/usr/local/bin/electron: line 2: 46288 Trace/BPT trap: 5       "/usr/local/lib/node_modules/electron-prebuilt/dist/Electron.app/Contents/MacOS/Electron" "$@"

How should I be bundling zmq? All I did to get it setup as part of the environment is running npm install --save zmq.

like image 804
Kyle Kelley Avatar asked Apr 30 '15 06:04

Kyle Kelley


1 Answers

You can use zeromq.js.

It has the same API as zmq but features prebuilt static binaries for Node and Electron. So there is no need for a proper C/C++ compiler toolchain:

npm install zeromq

For Electron specific instructions checkout https://github.com/zeromq/zeromq.js#rebuilding-for-electron.

like image 107
Lukas Geiger Avatar answered Oct 22 '22 11:10

Lukas Geiger