using compiled lib from cppan does not work

89 views
Skip to first unread message

Thomas

unread,
Aug 8, 2018, 6:22:59 PM8/8/18
to tesseract-ocr
Hey! I need help using a self compiled version of tesseract, because I struggle compiling my console app with the linked tesseract binaries which I've build.

1 Building tesseract
2 Using tesseract
  2.1 tesseract.exe - Works
  2.2 libtesseract.dll / .lib - Does not work

1 Building tesseract with cppan and MSVC 15 2017 v141
   cppan version 

   build.bat:
 cppan --build pvt.cppan.demo.google.tesseract.tesseract-master

  0 errors, 0 warnings

2 Using tesseract as a library
To test tesseract, I am using the api example from https://github.com/tesseract-ocr/tesseract/wiki/APIExample.
Moreover I define TESS_IMPORTS.

I try to link the libraries pvt.cppan.demo.danbloomberg.leptonica-1.76.0 and pvt.cppan.demo.google.tesseract.libtesseract-master.

There seem to be some symbols missing (not getting exported). With depend.exe I also could not find them. 
Any idea why? I looked at the cppan.yaml file and it seems to define TESS_EXPORTS so it should work...

Using MSVC 2017 build tools 141 + Visual Studio, I get LNK2001 complaining about missing symbols __declspec(dllimport) public: _cdecl tesseract::TessBaseAPI::TessBaseAPI(void)... and some others (see attachment). Last error is LNK1120 9 missing externals (translated)
Using QtCreator and a qmake based project I get LNK2019 and LNK1120.

There is a vcxproj example attached.

Greetings
Thomas
msvc linker errors.PNG
consoleapplication1.zip

flavi...@gmail.com

unread,
Oct 29, 2018, 5:45:17 AM10/29/18
to tesseract-ocr
Hi Tomas. Have you succeeded after all to compile Tesseract 4 for Windows ?

Flaviu.
Reply all
Reply to author
Forward
0 new messages