Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 11 fatal error: LNK1120: 1 unresolved externals [C:\...\node_modules\node-native-ocr\build\node-native-ocr.vcxproj #9

Open
stoefln opened this issue Mar 30, 2022 · 1 comment

Comments

@stoefln
Copy link
Owner

stoefln commented Mar 30, 2022

node -v v14.18.1
node-gyp -v v5.1.0

  tesseract.vcxproj -> C:\Users\steph\repeato-studio\node_modules\node-native-ocr\tesseract\build\bin\Release\tesseract.exe
  Building Custom Rule C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/CMakeLists.txt
Installing a Release build.
-- Install configuration: "Release"
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/lib/pkgconfig/tesseract.pc
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/bin/tesseract.exe
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/lib/tesseract41.lib
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/cmake/TesseractTargets.cmake
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/cmake/TesseractTargets-release.cmake
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/cmake/TesseractConfig.cmake
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/cmake/TesseractConfig-version.cmake
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/apitypes.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/baseapi.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/capi.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/renderer.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/tess_version.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/thresholder.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/ltrresultiterator.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/pageiterator.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/resultiterator.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/osdetect.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/publictypes.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/genericvector.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/helpers.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/ocrclass.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/platform.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/serialis.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/strngs.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/tesscallback.h
-- Installing: C:/Users/steph/repeato-studio/node_modules/node-native-ocr/tesseract/build//bin/include/tesseract/unichar.h
build-tesseract script end.

C:\Users\steph\repeato-studio\node_modules\node-native-ocr>if not defined npm_config_node_gyp (node "C:\Users\steph\AppData\Roaming\nvm\v14.18.1\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\steph\AppData\Roaming\nvm\v14.18.1\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  node-native-ocr.cc
  ocr.cc
  recognize.cc
  win_delay_load_hook.cc
     Creating library C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\Release\node-native-ocr.lib and object C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\Release\node-native-ocr.exp
tesseract41.lib(convolve.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(lstm.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(segsearch.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(findseam.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(topitch.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(oldbasel.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(colpartitiongrid.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(strokewidth.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(tablefind.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(tfacepp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(baselinedetect.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(wordseg.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(networkio.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(unicharcompress.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(colpartition.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(svutil.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(permdawg.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(clusttool.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(superscript.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(mainblk.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(params_model.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(paramsd.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(lstmrecognizer.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(tordmain.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(imagedata.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(boxread.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(normmatch.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(textord.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(language_model.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(pieces.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(trie.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(polyaprx.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(stopper.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(cutoffs.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(picofeat.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(scrollview.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(ambigs.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(dawg.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(equationdetect.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(osdetect.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(paragraphs.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(blamer.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(pageres.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(adaptmatch.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(control.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(pgedit.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(unicharset.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(ratngs.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(tessdatamanager.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(ocrpara.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(baseapi.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(unichar.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(strngs.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
tesseract41.lib(params.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\Release\node-native-ocr.node : fatal error LNK1120: 1 unresolved externals [C:\Users\steph\repeato-studio\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\steph\AppData\Roaming\nvm\v14.18.1\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\steph\\AppData\\Roaming\\nvm\\v14.18.1\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\steph\repeato-studio\node_modules\node-native-ocr
gyp ERR! node -v v14.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

Full log:

https://gist.github.com/stoefln/fa6fbe2975ea9f85d7e221124f23ef13

@jschlight
Copy link
Contributor

When creating the build tool, I made the decision to retain the build products between builds to speed up the build process while in the development process. It’s possible that there are binaries left over from the version of Visual Studio you were running before installing Visual Studio 2019.

For example, in your full build log, I notice there is a link error associated with tessdatamanager.obj. But I don’t see the corresponding compiler command. This leads me to believe tessdatamanager.obj binary might have been built with an earlier version of Visual Studio which could explain the linking error.

As a first step, I recommend that you try this command to clean out the build products:

npm run clean-tesseract

And then try the:

npm install 

@stoefln stoefln changed the title Installing in Windows 11 leads to error Windows 11 fatal error: LNK1120: 1 unresolved externals [C:\...\node_modules\node-native-ocr\build\node-native-ocr.vcxproj May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants