[英]node-gyp resolving external library symbols on windows build
我正在嘗試在Windows 10上使用MS VS 2015構建節點模塊,由於某種原因,它無法解析node-gyp build
上的庫符號。 這是我的binding.gyp
文件:
{
'variables' : {
'include_path' : 'path/to/include',
'lib_path': '/path/to/lib',
},
'targets': [
{
// name and sources here
'include_dirs': [
'<(include_path)',
],
'libraries': [
'<(lib_path)',
],
},
],
}
由於某種原因,它無法解析庫中的任何符號。 這是輸出的代碼段:
ProjectBuild.obj : error LNK2001: unresolved external symbol __imp__AiMsgSetLogFileFlags [\path\to\build\project_build.vcxproj]
ProjectBuild.obj : error LNK2001: unresolved external symbol __imp__AiRenderInterrupt [\path\to\build\project_build.vcxproj]
此外,這是該庫的目標文件轉儲中的那些符號的反匯編:
Disassembly of section .text:
0000000000000000 <AiMsgSetLogFileFlags>:
0: ff 25 00 00 00 00 jmpq *0x0(%rip) # 6 <AiMsgSetLogFileFlags+0x6>
6: 90 nop
7: 90 nop
ai.dll: file format pei-x86-64
Disassembly of section .text:
0000000000000000 <AiRenderInterrupt>:
0: ff 25 00 00 00 00 jmpq *0x0(%rip) # 6 <AiRenderInterrupt+0x6>
6: 90 nop
7: 90 nop
ai.dll: file format pei-x86-64
我可以100%確定地確認node-gyp正在查找庫文件。 有誰知道為什么在鏈接該文件中的符號時遇到麻煩? 對於它的價值,我能夠使用完全相同的binding.gyp文件在Linux環境中構建該模塊。
您需要研究確保要導出的符號具有此符號。 https://msdn.microsoft.com/zh-CN/library/3y1sfaz2%28v=vs.140%29.aspx
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.