Building Electron Native Extensions using Visual Basic 2015

和自甴很熟 提交于 2019-12-24 08:37:46

问题


Where I am currently:

I have began working on a NodeJS native extension I intend to work with Electron, but from previous works I have noted that the build steps for building for just NodeJS are as expected, include the libraries as per instruction and change to output a .dll file with a .node extension.

The problem I am facing:

When compiling my extension, which tried and tested within NodeJS, does not work within an Electron contained instance of NodeJS - from searching around I understand this to be a problem with the header files which I am compiling against etc. The documentation for building with visual studio (not Visual Studio Code) is very sparse and everywhere generally points to using node-gyp - which is something I'm attempting to avoid and build using purely Visual Studio 2015.

For reference, when running the working (in NodeJS) NativeExtension I get the following error (which googling brought me to the conclusion I am compiling against the wrong thing):

ELECTRON_ASAR.js:167 Uncaught Error: Module did not self-register.

Could someone please shed some light on where I may be going wrong? I am a novice when it comes to C++ program structure and compiling methodologies.


回答1:


The documentation for building with visual studio (not Visual Studio Code) is very sparse and everywhere generally points to using node-gyp - which is something I'm attempting to avoid and build using purely Visual Studio 2015.

There is a standard way of compiling native Node modules, and as a self admitted novice it would be unwise to deviate from it. I suggest you read through the Microsoft NodeJS guidelines and get your development environment properly configured to build via node-gyp, once that's working you can start figuring out how to rebuild native Node modules for Electron.



来源:https://stackoverflow.com/questions/39249202/building-electron-native-extensions-using-visual-basic-2015

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!