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

setup.py build fails with LINK : error LNK2001: unresolved external symbol _DllMainCRTStartup #279

Open
quaesitor-scientiam opened this issue Sep 25, 2021 · 1 comment

Comments

@quaesitor-scientiam
Copy link

The list of unresolved symbols below:

   Creating library build\temp.win-amd64-3.7\Release\tesserocr.cp37-win_amd64.lib and object build\temp.win-amd64-3.7\Release\tesserocr.cp37-win_amd64.exp
tesserocr.obj : error LNK2001: unresolved external symbol __CxxFrameHandler4
tesserocr.obj : error LNK2001: unresolved external symbol __security_check_cookie
tesserocr.obj : error LNK2001: unresolved external symbol __std_exception_destroy
tesserocr.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *,unsigned __int64)" (??_V@YAXPEAX_K@Z)
tesserocr.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned __int64)" (??2@YAPEAX_K@Z)
tesserocr.obj : error LNK2001: unresolved external symbol _Query_perf_frequency
tesserocr.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPEBD@Z)
tesserocr.obj : error LNK2001: unresolved external symbol "void __cdecl `eh vector destructor iterator'(void *,unsigned __int64,unsigned __int64,void (__cdecl*)(void *))" (??_M@YAXPEAX_K1P6AX0@Z@Z)
tesserocr.obj : error LNK2001: unresolved external symbol __std_exception_copy
tesserocr.obj : error LNK2001: unresolved external symbol atexit
tesserocr.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
tesserocr.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned __int64)" (??_U@YAPEAX_K@Z)
tesserocr.obj : error LNK2001: unresolved external symbol __std_terminate
tesserocr.obj : error LNK2001: unresolved external symbol strchr
tesserocr.obj : error LNK2001: unresolved external symbol _Query_perf_counter
tesserocr.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
tesserocr.obj : error LNK2001: unresolved external symbol "void __cdecl `eh vector constructor iterator'(void *,unsigned __int64,unsigned __int64,void (__cdecl*)(void *),void (__cdecl*)(void *))" (??_L@YAXPEAX_K1P6AX0@Z2@Z)

The type of symbols that are missing seems to me be related this article by Microsoft on how DLLs should be written.

I not familiar with how the Python setup.py build works with this concept.

I am using Windows 10 Pro 64bit, Visual Studio 2019. I used vcpkg to pull everything related to tesseract 4.1.1 and have the necessary paths setup to point to the installed vcpkg includes and libs.

I tried the pip installed first but it choked on this same link error. I was hoping by building via source I might get better results.

Appreciate any help or pointers on how to resolve this.

Thanks

@zdenop
Copy link
Contributor

zdenop commented Sep 26, 2021

Please follow instructions in https://github.com/sirfz/tesserocr/blob/master/Windows.build.md
This is the only supported way for windows tesserocr.
AFAIK vcpkg is able to create only static linked tesseract library which causes a lot of pain when linking....

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