簡體   English   中英

node-gyp構建提供了未解決的外部符號錯誤

[英]node-gyp build gives unresolved external symbol error

我正嘗試使用swig訪問c ++代碼形式的javascript。 現在,當我嘗試運行命令node-gyp configure build ,出現以下錯誤。 任何人都可以在這里幫助我,並說明為什么會這樣

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是一個元構建系統,為您的情況下的各種構建系統MSBuild生成文件。 就您而言,稍后在MSBuild級別而不是node-gyp級別會發生錯誤。

您正在使用某些標頭,其中定義了所有這些功能,但未鏈接到相應的*.lib庫或*.c / .cpp源。

您的庫似乎是與文檔掃描設備有關的專有庫。

您可以使用GYP文件的“ libraries部分鏈接到此缺少的庫:

'libraries': ['mylibrary.lib']

然后重建MSBuild文件:

node-gyp configure

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM