Undefined Reference errors when building Tesseract OCR

598 views
Skip to first unread message

Mich Po

unread,
Oct 3, 2018, 5:52:40 PM10/3/18
to tesseract-ocr
I added these lines to CMakeLists.txt in Tesseract, it builds to 99% then I get a lot of undefined reference errors below.
The leptonica library is built on the same machine using the same arm toolchain. 


set(Leptonica_DIR "C:/opencv/leptonica/build")
set(Leptonica_LIBRARIES} "C:/opencv/leptonica/build/src")
add_library(leptonica STATIC IMPORTED)
set_target_properties(leptonica PROPERTIES
  IMPORTED_LOCATION "C:/opencv/leptonica/build/src/libleptonica.so"
  INTERFACE_INCLUDE_DIRECTORIES "C:/opencv/leptonica/build/src"
)
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)


What am I missing here?



Severity Code Description Project File Line Suppression State
Error  undefined reference to `getLeptonicaVersion' Tesseract.vgdbcmake C:\opencv\tesseract\src\api\tesseractmain.cpp 65 
Error  undefined reference to `lept_free' Tesseract.vgdbcmake C:\opencv\tesseract\src\api\tesseractmain.cpp 67 
Error  undefined reference to `getImagelibVersions' Tesseract.vgdbcmake C:\opencv\tesseract\src\api\tesseractmain.cpp 69 
Error  undefined reference to `lept_free' Tesseract.vgdbcmake C:\opencv\tesseract\src\api\tesseractmain.cpp 71 
Error  undefined reference to `setMsgSeverity' Tesseract.vgdbcmake C:\opencv\tesseract\src\api\tesseractmain.cpp 480 
Error  undefined reference to `pixRead' Tesseract.vgdbcmake C:\opencv\tesseract\src\api\tesseractmain.cpp 553 
Error  undefined reference to `pixDestroy' Tesseract.vgdbcmake C:\opencv\tesseract\src\api\tesseractmain.cpp 579 
Error  undefined reference to `pixCloseBrick' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixForegroundFraction' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetMasked' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixRenderPolylineArb' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `numaGetIValue' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixRenderPolyline' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixRenderBoxArb' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixClipBoxToForeground' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `l_getFormattedDate' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `zlibCompress' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `boxaCreate' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetInRect' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `bmfDestroy' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixRotateOrth' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `boxaAddBox' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixReadMemFromMultipageTiff' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `l_generateCIDataForPdf' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixCreate' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixZero' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixCountConnComp' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `numaDestroy' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixaClear' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetXRes' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixRemoveColormap' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetText' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `boxaGetBox' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetAll' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixaReplacePix' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixClearInRect' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixErodeBrick' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixaConvertToPdf' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixDilateBrick' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetInputFormat' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixaAddPix' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `ptaDestroy' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGenerateHalftoneMask' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetWidth' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixaAddBox' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixaGetPix' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `boxCreate' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `ptaCreate' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixAddSingleTextblock' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixOr' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixAnd' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `numaGetCount' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixRasterop' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetHeight' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetColormap' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetDimensions' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixRotate180' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixExpandReplicate' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `findFileFormatBuffer' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixBlockconv' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetSpp' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixRemoveAlpha' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixClone' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixReadFromMultipageTiff' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetWpl' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixaDisplayTiledInColumns' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetYRes' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixCopy' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `l_CIDataDestroy' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `boxaGetCount' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `boxaReplaceBox' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixWrite' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixReadMem' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetAllArbitrary' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixConvertTo32' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixWriteStreamPng' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `boxaGetBoxGeometry' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetData' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixDistanceFunction' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixClipRectangle' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetOrClearBorder' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixScale' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixCountPixelsByRow' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `boxDestroy' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixaDestroy' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixCountPixels' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `findFileFormat' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetPixel' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixCreateTemplate' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixInvert' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixReduceRankBinaryCascade' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetSpp' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixOpenBrick' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `bmfCreate' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixConvertRGBToLuminance' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSubtract' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixConnComp' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGenerateCIData' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixaCreate' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetYRes' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixaGetCount' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `ptaAddPt' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetXRes' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetInRectArbitrary' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixGetDepth' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSetPixel' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `composeRGBPixel' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixWriteMem' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixConvertTo8' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `boxGetGeometry' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `boxaDestroy' Tesseract.vgdbcmake libtesseract.so.4.0.0  
Error  undefined reference to `pixSeedfillBinary' Tesseract.vgdbcmake libtesseract.so.4.0.0  

Soumik Ranjan Dasgupta

unread,
Oct 12, 2018, 4:04:04 AM10/12/18
to tesser...@googlegroups.com
Do you have libtesseract installed?

--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/feed78bb-9b7f-462c-95c4-b8ce8f8533a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Regards,
Soumik Ranjan Dasgupta

Zdenko Podobny

unread,
Oct 12, 2018, 9:14:00 AM10/12/18
to tesser...@googlegroups.com
Seem like you miss to learn tools you are using ;-) 
Because otherwise you would know that you forget to link your output (tesseract ?) with missing library (leptonica)

Zdenko


st 3. 10. 2018 o 23:52 Mich Po <dmitr...@gmail.com> napísal(a):
--
Reply all
Reply to author
Forward
0 new messages