Error LNK2019: unresolved external symbol "public: __cdecl tesseract::TessBaseAPI::TessBaseAPI(void)"
Environment:
- Python => 3.9
- Node => 11.15 (Also tried using 14)
- Node-Gyp => 8.2 (Globally installed) - But in error I can see => node-gyp -v v3.8.0
- Npm => 6.7
Unable to install this package getting the following errors during build:
- Error LNK2019: unresolved external symbol "public: __cdecl tesseract::TessBaseAPI::TessBaseAPI(void)"
- fatal error LNK1120: 7 unresolved externals [C:\Users\MyUserName\Documents\project\node_modules\node-native-ocr\build\node-native-ocr.vcxproj]
See attached screenshots for reference

Same error with python v2.7

@ahmedmukhtar1133 Would it be possible to get the full build log, including the build command you are using to trigger the build, as plain text either pasted into a comment here or as a gist?
@jschlight I just ran the npm install command to install the dependencies.
Here is the complete npm debug log file attached.
File is huge, you might want to search through file node-native-ocr
2021-10-05T22_12_10_891Z-debug.log
.
@ahmedmukhtar1133 Thank you. I wasn't clear in my request. You sent what I asked for. I'm hoping to get a textual version of the console output in the screenshots you posted. Can you please verify the following software versions you are running:
- Microsoft Windows
- Visual Studio
- CMake
I can confirm the code builds with Visual Studio Build Tools 2019. But it may not build with other versions.
- Windows: 10
- Visual Studio: 2017
- Cmake: 3.21
As you suggested it might work with VS 2019 build tools, so I'll check again with vs 2019. Incase I get any errors then I'll provide you textual version of the console errors.
I've tried with VS 2019 build tools but it's still not working.
Finally, after trying different combinations have fixed this issue.
- Windows: 10
- Visual Studio (Build tools, C++ Packages, and Windows SDK): VS Build Tools 2019
- Cmake: 3.21
- Node: 14.16
- Python: 2.7
Might help someone.