私は、アンパック電子アプリケーションでopenSSLライブラリを使用するネイティブアドオンを持っています。窓10に それが動作し、それが働いていない7 Windows上で、私はこの受け付けております:電子ネイティブアドオンがウィンドウに表示されない
Error: The specified module could not be found.
\\?\C:\Program Files (x86)\AppX Player\resources\app\src\addon\foo.node
at Error (native)
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:167:20)
at Object.Module._extensions..node (module.js:568:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:167:20)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Program Files (x86)\AppX Player\resources\app\s
rc\addon\index.js:11:3)
私は電子のWindows IA32アーキテクチャーをターゲットにしていると私は次のようにそれを再構築します。
node-gyp rebuild --target=1.3.1 --arch=ia32 --dist-url=https://atom.io/download/atom-shell --verbose
を
ファイルのbinding-gypはこのようになり、thisに基づいています。それは、OpenSSLスタティックライブラリを使用
{それは私の同じレベル上のOpenSSL DLLを追加DLLが(私は静的ライブラリをリンクしたように、それがあるべきではない)が欠落しただけの場合に
"targets": [
{
"target_name": "addon",
"sources": [
"./src/encryptor.cpp" ,
"./src/EncryptorHandler.cpp",
"./src/SetupHandler.cpp",
"./src/RC4Handler.cpp",
"./src/HardwareInfoHandler.cpp",
"../Encryptions/RC4.cpp",
"../Encryptions/AES.cpp",
"../Encryptions/utils.cpp",
"../oggEncDec/src/FileHandler.cpp",
"../oggEncDec/src/OGGSelectiveEncryptor.cpp",
"../machineIdentification/common.cpp"
],
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
'cflags': ['-fexceptions'],
'cflags_cc': ['-fexceptions -Wall -Wextra -Wconversion'],
"include_dirs": [
"<!(node -e \"require('nan')\")",
"../"
],
'conditions': [
['OS=="linux"', {
"sources": [
"../machineIdentification/linuxHardwareInfo.cpp"
],
'libraries': [
'-lcrypto',
],
}
],
['OS=="mac"', {
"sources": [
"../machineIdentification/macHardwareInfo.cpp"
],
'libraries': [
'-lcrypto',
],
}],
['OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [ '/EHsc' ],
'ExceptionHandling': 1
}
},
"sources": [
"../machineIdentification/windowsHardwareInfo.cpp"
],
'conditions': [
# "openssl_root" is the directory on Windows of the OpenSSL files.
# Check the "target_arch" variable to set good default values for
# both 64-bit and 32-bit builds of the module.
['target_arch=="x64"', {
'variables': {
'openssl_root%': 'C:/OpenSSL-Win64'
},
}, {
'variables': {
'openssl_root%': 'C:/OpenSSL-Win32'
},
}],
],
'libraries': [
'-l<(openssl_root)/lib/libeay32.lib',
],
'include_dirs': [
'<(openssl_root)/include',
],
}]
]
}
]
}
EXE。これ以外に何が原因でしょうか? OpenSSLのバイナリをインストール
編集 は、それが動作します、私はので、私は、私はできればすべてが解決されるだろう、外部DLLの
編集2 には依存しません静的リンクは、そのの世話をするだろうと思いました静的ライブラリをパックし、それを ".node"ファイルにバンドルします。 .nodeファイルでdependency walkerを使用すると、DLLが必要であることがわかり、必要なのはdllコードを持つためです。
各OpenSSLの設定は異なります。 'CFLAGS'と' CXXFAGS'の1組はできません。特に32ビットと64ビットのアプリケーション間では間に合わない。 [Build Multiarch OpenSSL on OS X](http://stackoverflow.com/q/25530429)も参照してください。 OS Xのビットについて心配する必要はありません。むしろ、「BIGNUM」のようなものの違いに焦点を当てる。クイック/ダーティな解決法:各プラットフォームに対して '。/ Configure'を実行し、' CFLAGS'をコピーします。 Configureは 'CFLAGS'を表示するので、簡単にコピー/ペーストできます。 – jww
見てみて、それを感謝しようとします、ありがとう! – FabioCosta
私はdependency walkerでチェックしました.nodeをコンパイルすると、それにはDLLの依存関係があります。リンクされたコードを "コピー"して.nodeと一緒にコンパイルされ、dllは必要ありません。 – FabioCosta