I'm trying to build a node module on Windows 10 with MS VS 2015 and for some reason it's unable to resolve library symbols on node-gyp build
. Here is my binding.gyp
file:
{
'variables' : {
'include_path' : 'path/to/include',
'lib_path': '/path/to/lib',
},
'targets': [
{
// name and sources here
'include_dirs': [
'<(include_path)',
],
'libraries': [
'<(lib_path)',
],
},
],
}
For some reason, it's unable to resolve any symbols in the library. Here is a snippet of the output:
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]
In addition, here is the disassembly of those symbols in the object file dump for that library:
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
I can confirm with 100% certainty that node-gyp is finding the library file. Does anyone know why it's having trouble linking the symbols in that file? For what it's worth, I'm able to build the module just fine in a linux environment with the exact same binding.gyp file.