I'm trying to access c++ code form javascript and for which I used swig. Now when i try to run the command node-gyp configure build
I got the below errors. Can anyone help me here and tell why this is happening
C:\Users\UAL\Desktop\DeskoPenta\Code\SwigWithDeskoCode>node-gyp configure build
gyp info it worked if it ends with okQA
gyp info using node-gyp@3.8.0
gyp info using node@10.14.2 | win32 | x64
gyp info spawn C:\Users\UAL\.windows-build-tools\python27\python.exe
gyp info spawn args [ 'C:\\Users\\UAL\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=2015',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\UAL\\Desktop\\DeskoPenta\\Code\\SwigWithDeskoCode\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\UAL\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\UAL\\.node-gyp\\10.14.2\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\UAL\\.node-gyp\\10.14.2',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\UAL\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\Users\\UAL\\.node-gyp\\10.14.2\\<(target_arch)\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Users\\UAL\\Desktop\\DeskoPenta\\Code\\SwigWithDeskoCode',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\Users\\UAL\\Desktop\\DeskoPenta\\Code\\SwigWithDeskoCode\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Creating library C:\Users\UAL\Desktop\DeskoPenta\Code\SwigWithDeskoCode\build\Release\example.lib and object C:\Us
ers\UAL\Desktop\DeskoPenta\Code\SwigWithDeskoCode\build\Release\example.exp
example.obj : error LNK2001: unresolved external symbol __imp_DMRZGetDocType [C:\Users\UAL\Desktop\DeskoPenta\Code\Swig
WithDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_DMRZGetField [C:\Users\UAL\Desktop\DeskoPenta\Code\SwigWi
thDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_DMRZDestroyHandle [C:\Users\UAL\Desktop\DeskoPenta\Code\S
wigWithDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_DMRZCreateMrzDescriptor [C:\Users\UAL\Desktop\DeskoPenta\
Code\SwigWithDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_DMRZValidateAllChecksums [C:\Users\UAL\Desktop\DeskoPenta
\Code\SwigWithDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_DMRZParseMrz [C:\Users\UAL\Desktop\DeskoPenta\Code\SwigWi
thDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_ConnectToDevice [C:\Users\UAL\Desktop\DeskoPenta\Code\Swi
gWithDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_PrepareBmpClippedDocumentImage [C:\Users\UAL\Desktop\Desk
oPenta\Code\SwigWithDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_GetPropertyString [C:\Users\UAL\Desktop\DeskoPenta\Code\S
wigWithDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_SetupOnDevicePlugCallback [C:\Users\UAL\Desktop\DeskoPent
a\Code\SwigWithDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_GetMsrOutput [C:\Users\UAL\Desktop\DeskoPenta\Code\SwigWi
thDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_SetupOnOcrCallback [C:\Users\UAL\Desktop\DeskoPenta\Code\
SwigWithDeskoCode\build\example.vcxproj]
example.obj : error LNK2001: unresolved external symbol __imp_UseBuzzer [C:\Users\UAL\Desktop\DeskoPenta\Code\SwigWithD
eskoCode\build\example.vcxproj]
example_wrap.obj : error LNK2001: unresolved external symbol __imp_GetBuzzerSettings2 [C:\Users\UAL\Desktop\DeskoPenta\
Code\SwigWithDeskoCode\build\example.vcxproj]
C:\Users\UAL\Desktop\DeskoPenta\Code\SwigWithDeskoCode\build\Release\example.node : fatal error LNK1120: 134 unresolved
externals [C:\Users\UAL\Desktop\DeskoPenta\Code\SwigWithDeskoCode\build\example.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\UAL\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\UAL\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Users\UAL\Desktop\DeskoPenta\Code\SwigWithDeskoCode
gyp ERR! node -v v10.14.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
GYP is a meta-build system that generates files for various build systems, MSBuild, in your case. In your case, error occurs later at MSBuild level, not node-gyp level.
You are using certain headers where all these functions are defined, but not linking against the corresponding *.lib
library or *.c
/.cpp
sources.
Your library seems to be a proprietary library related to document scanning devices.
You can link against this missing library by using libraries
section of the GYP file:
'libraries': ['mylibrary.lib']
And then rebuild MSBuild files:
node-gyp configure