I am trying to compile Leptonica and Tesseract with mingw+msys so i can compile and use C++ programs including Tesseract using mingw. I am total begginer with building libraries by myself (to be honest i have never built any and i was just using library built with VC++, but its not enought for me now).
All i do is based on this tutorial:
http://www.sk-spell.sk.cx/compiling-leptonica-and-tesseract-ocr-with-mingwmsysI have built all the libraries with same versions as there is written in tutorial just not Leptonica (and Tesseract ofc), but i am not sure about giflib and libwebp libraries. That is becouse when i try to make && make install Leptonica library i get that:
(...)
*** Warning: This system can not link to static lib archive
c:/mingw/lib/libgif.la.
*** I have the capability to make that library automatically
link in when
*** you link to this library. But I can only do this if you
have a
*** shared version of the library, which you do not appear t
o have.
*** Warning: This system can not link to static lib archive
c:/mingw/lib/libwebp.la.
*** I have the capability to make that library automatically
link in when
*** you link to this library. But I can only do this if you
have a
*** shared version of the library, which you do not appear t
o have.libtool: link: rm -fr .libs/liblept.dll.a
libtool: link: gcc -shared .libs/adaptmap.o .libs/affine.o
.libs/affinecompose.o .libs/arithlow.o .libs/arrayaccess.o .
libs/bardecode.o .libs/baseline.o .libs/bbuffer.o .libs/bili
near.o .libs/binarize.o .libs/binexpand.o .libs/binexpandlow
.o .libs/binreduce.o .libs/binreducelow.o .libs/blend.o .lib
s/bmf.o .libs/bmpio.o .libs/bmpiostub.o .libs/boxbasic.o .li
bs/boxfunc1.o .libs/boxfunc2.o .libs/boxfunc3.o .libs/boxfun
c4.o .libs/bytearray.o .libs/ccbord.o .libs/ccthin.o .libs/c
lassapp.o .libs/colorcontent.o .libs/coloring.o .libs/colorm
ap.o .libs/colormorph.o .libs/colorquant1.o .libs/colorquant
2.o .libs/colorseg.o .libs/colorspace.o .libs/compare.o .lib
s/conncomp.o .libs/convertfiles.o .libs/convolve.o .libs/con
volvelow.o .libs/correlscore.o .libs/dewarp.o .libs/dnabasic
.o .libs/dwacomb.2.o .libs/dwacomblow.2.o .libs/edge.o .libs
/enhance.o .libs/fhmtauto.o .libs/fhmtgen.1.o .libs/fhmtgenl
ow.1.o .libs/finditalic.o .libs/flipdetect.o .libs/fliphmtge
n.o .libs/fmorphauto.o .libs/fmorphgen.1.o .libs/fmorphgenlo
w.1.o .libs/fpix1.o .libs/fpix2.o .libs/gifio.o .libs/gifios
tub.o .libs/gplot.o .libs/graphics.o .libs/graymorph.o .libs
/graymorphlow.o .libs/grayquant.o .libs/grayquantlow.o .libs
/heap.o .libs/jbclass.o .libs/jpegio.o .libs/jpegiostub.o .l
ibs/kernel.o .libs/leptwin.o .libs/libversions.o .libs/list.
o .libs/maze.o .libs/morph.o .libs/morphapp.o .libs/morphdwa
.o .libs/morphseq.o .libs/numabasic.o .libs/numafunc1.o .lib
s/numafunc2.o .libs/pageseg.o .libs/paintcmap.o .libs/parsep
rotos.o .libs/partition.o .libs/pdfio.o .libs/pdfiostub.o .l
ibs/pix1.o .libs/pix2.o .libs/pix3.o .libs/pix4.o .libs/pix5
.o .libs/pixabasic.o .libs/pixacc.o .libs/pixafunc1.o .libs/
pixafunc2.o .libs/pixalloc.o .libs/pixarith.o .libs/pixcomp.
o .libs/pixconv.o .libs/pixtiling.o .libs/pngio.o .libs/pngi
ostub.o .libs/pnmio.o .libs/pnmiostub.o .libs/projective.o .
libs/psio1.o .libs/psio1stub.o .libs/psio2.o .libs/psio2stub
.o .libs/ptabasic.o .libs/ptafunc1.o .libs/ptra.o .libs/quad
tree.o .libs/queue.o .libs/rank.o .libs/readbarcode.o .libs/
readfile.o .libs/regutils.o .libs/rop.o .libs/ropiplow.o .li
bs/roplow.o .libs/rotate.o .libs/rotateam.o .libs/rotateamlo
w.o .libs/rotateorth.o .libs/rotateorthlow.o .libs/rotateshe
ar.o .libs/runlength.o .libs/sarray.o .libs/scale.o .libs/sc
alelow.o .libs/seedfill.o .libs/seedfilllow.o .libs/sel1.o .
libs/sel2.o .libs/selgen.o .libs/shear.o .libs/skew.o .libs/
spixio.o .libs/stack.o .libs/sudoku.o .libs/textops.o .libs/
tiffio.o .libs/tiffiostub.o .libs/utils.o .libs/viewfiles.o
.libs/warper.o .libs/watershed.o .libs/webpio.o .libs/webpio
stub.o .libs/writefile.o .libs/zlibmem.o .libs/zlibmemstub.o
/usr/local/lib/libpng15.dll.a /usr/local/lib/libtiff.dll.
a -L/usr/local/lib /usr/local/lib/libjbig.dll.a /usr/local/l
ib/libjpeg.dll.a -lz -lgdi32 -O2 -Wl,--as-needed -o .libs
/liblept-3.dll -Wl,--enable-auto-image-base -Xlinker --out-i
mplib -Xlinker .libs/liblept.dll.a
Creating library file: .libs/liblept.dll.a
.libs/gifio.o: In function `pixReadStreamGif':
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:103: undefi
ned reference to `DGifOpenFileHandle'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:108: undefi
ned reference to `DGifSlurp'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:200: undefi
ned reference to `DGifCloseFile'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:109: undefi
ned reference to `DGifCloseFile'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:122: undefi
ned reference to `DGifCloseFile'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:141: undefi
ned reference to `DGifCloseFile'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:165: undefi
ned reference to `DGifCloseFile'
.libs/gifio.o:C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio
.c:114: more undefined references to `DGifCloseFile' follow
.libs/gifio.o: In function `pixWriteStreamGif':
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:319: undefi
ned reference to `MakeMapObject'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:340: undefi
ned reference to `EGifOpenFileHandle'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:347: undefi
ned reference to `EGifPutScreenDesc'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:350: undefi
ned reference to `FreeMapObject'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:351: undefi
ned reference to `EGifCloseFile'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:328: undefi
ned reference to `FreeMapObject'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:354: undefi
ned reference to `FreeMapObject'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:356: undefi
ned reference to `EGifPutImageDesc'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:358: undefi
ned reference to `EGifCloseFile'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:398: undefi
ned reference to `EGifPutLine'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:411: undefi
ned reference to `EGifPutComment'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:417: undefi
ned reference to `EGifCloseFile'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:342: undefi
ned reference to `FreeMapObject'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:401: undefi
ned reference to `EGifCloseFile'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:366: undefi
ned reference to `EGifCloseFile'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/gifio.c:372: undefi
ned reference to `EGifCloseFile'
.libs/webpio.o: In function `pixReadStreamWebP':
C:\MinGW\msys\1.0\src\leptonica-1.69\src/webpio.c:88: undefi
ned reference to `WebPGetInfo'
C:\MinGW\msys\1.0\src\leptonica-1.69\src/webpio.c:100: undef
ined reference to `WebPDecodeRGBAInto'
.libs/webpio.o: In function `readHeaderWebP':
C:\MinGW\msys\1.0\src\leptonica-1.69\src/webpio.c:143: undef
ined reference to `WebPGetInfo'
.libs/webpio.o: In function `pixWriteStreamWebP':
C:\MinGW\msys\1.0\src\leptonica-1.69\src/webpio.c:250: undef
ined reference to `WebPEncodeRGBA'
collect2: ld returned 1 exit status
make[2]: *** [liblept.la] Error 1
make[2]: Leaving directory `/usr/src/leptonica-1.69/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/leptonica-1.69'
make: *** [all] Error 2I think these errors occurs becouse of the previous warnings. It looks like there is no shared lib version but i build both of the libraries and they build shared libraries in default.
By the way, I think that in the tutorial LDFLAGS="-no-undefined -Wl,--as-needed" its not proper
and it should be LDFLAGS="-Wl,--no-undefined -Wl,--as-needed".
I was trying to find some solution but no success so far. I will appreciate any help.