Unable to link my C++ library with electron



I have my own c++ library and I want to use it in my electron app, but when l try to launch my app the following error appears : :

If I use my addon out of the electron app it runs correctly.

My electron app main process :

'use strict';
const addon = require('./build/Release/addon.node');
const electron = require('electron');
const app = electron.app; //Module to control application life
const BrowserWindow = electron.BrowserWindow; // Module to create native browser window
const ipcMain = electron.ipcMain;
var mainWindow = null;

  if(process.platform != 'darwin'){

  mainWindow = new BrowserWindow({width:800,height:600});

  mainWindow.loadURL('file://'+ __dirname + '/static/index.html');

  mainWindow = null;

ipcMain.on('rInt',function(event, arg){
  obj = new addon.RandomGenerator(false);

Let me know if you need more information.


Did you rebuild your native module for Electron as specified in https://github.com/atom/electron/blob/v0.36.5/docs/tutorial/using-native-node-modules.md ?



I only tried the easy way cause I don’t understand how to use the other ways on windows.


It’s finally work with node-gyp way, I think I don’t sleep enough last night.

Anyway, thanks for your quick answer !