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

tesseract training tools under msys2/mingw64 don't build #562

Closed
djusHa opened this issue Dec 11, 2016 · 13 comments
Closed

tesseract training tools under msys2/mingw64 don't build #562

djusHa opened this issue Dec 11, 2016 · 13 comments

Comments

@djusHa
Copy link

djusHa commented Dec 11, 2016

Hi,

building training tools in current master branch under MSYS2/mingw64 throws following Error:
...x86_64-w64-mingw32/bin/ld.exe: cannot find -licui18n

It seems the lib is named differently.

My quick Solution is to change libicu in training/Makefile like so:
sed -i 's/^libicu = -licui18n -licuuc/libicu = -licuin -licuuc/' training/Makefile

Then it's building fine.

Thanks for your awesome Work.

@zdenop
Copy link
Contributor

zdenop commented Dec 11, 2016

Can you try revert this 7755e05 ?

@stweil
Copy link
Member

stweil commented Dec 11, 2016

Current Mingw-w64 as included in Cygwin includes these libraries in package mingw64-x86_64-icu: libicudata.dll.a libicui18n.dll.a libicuio.dll.a libicule.dll.a libiculx.dll.a libicutest.dll.a libicutu.dll.a libicuuc.dll.a, so that should work. It looks as if you got an older version of icu. Which version of Mingw-w64 did you use?

@stweil
Copy link
Member

stweil commented Dec 11, 2016

@zdenop, reverting that commit will work with old versions of icu. We don't support them for Linux, and for Windows there are also newer versions available. If support for both old and new versions is required, we need a test in configure.

@djusHa
Copy link
Author

djusHa commented Dec 11, 2016

@stweil
where can i see the version of mingw-w64?

Ouput from mingw64 console:
$ uname -rv
2.6.0(0.304/5/3) 2016-09-07 20:45

Output from pacman:
$ pacman -Qs icu
local/icu 56.1-1 (libraries)
International Components for Unicode library
local/icu-devel 56.1-1 (development)
ICU headers and libraries
local/mingw-w64-x86_64-icu 57.1-1
International Components for Unicode library (mingw-w64)

This files: libicudata.dll.a libicui18n.dll.a libicuio.dll.a libicule.dll.a libiculx.dll.a libicutest.dll.a libicutu.dll.a libicuuc.dll.a seems to be present in '/usr/lib'

My host is Windows 7 x64, msys2 installed a few days ago, must be pretty up to date.

@stweil
Copy link
Member

stweil commented Dec 11, 2016

If you use MSYS / MinGW from http://www.mingw.org/, then even the latest installation is old. :-(
That packages are not suitable for builds of Tesseract (old libraries, old compiler, only 32 bit). Don't use them for Tesseract 4.

Use Mingw-w64 from https://mingw-w64.org/ or install Cygwin from https://cygwin.com/ with the mingw64-* packages. Both solutions allow building 32 or 64 bit Tesseract for Windows.

@djusHa
Copy link
Author

djusHa commented Dec 11, 2016

I'm using MSYS2 Installer from https://msys2.github.io/
Have no Problems to compile other Linux Packages...

@stweil
Copy link
Member

stweil commented Dec 11, 2016

I'll have a look tomorrow. Good night for today.

@djusHa
Copy link
Author

djusHa commented Dec 11, 2016

ok, good night.

@stweil
Copy link
Member

stweil commented Dec 13, 2016

msys2.github.io provides a recent package mingw64/mingw-w64-x86_64-icu 57.1-1 with these libraries in /mingw64/lib:

libicudt.dll.a  libicuin.dll.a    libicuio.dll.a  libicule.dll.a
libiculx.dll.a  libicutest.dll.a  libicutu.dll.a  libicuuc.dll.a

This results in the reported build error.

Cygwin has a package mingw64-x86_64-icu 57.1-2 with these files in /usr/x86_64-w64-mingw32/sys-root/mingw/lib:

libicudata.dll.a  libicuio.dll.a  libiculx.dll.a    libicutu.dll.a
libicui18n.dll.a  libicule.dll.a  libicutest.dll.a  libicuuc.dll.a

Note that the versions are nearly identical. I was wrong when I thought that it was a problem of old versions of libicu. We need a configure which supports both variants. I'll send a PR.

@stweil
Copy link
Member

stweil commented Dec 13, 2016

PR #572 addresses all issues which I had with the MSYS2 Installer from https://msys2.github.io/.

@djusHa
Copy link
Author

djusHa commented Dec 13, 2016

Thanks for your effort!

@stweil
Copy link
Member

stweil commented Dec 13, 2016

@djusHa, the latest version in git includes the changes now. Don't forget to run ./autogen.sh before trying a new build.

@djusHa
Copy link
Author

djusHa commented Dec 13, 2016

Thumbs up! :-)

It compiles fine now.
Even with the PKGBUILD from Tesseract Wiki:
https://github.com/tesseract-ocr/tesseract/wiki/Compiling#msys2

Thanks for fixing.

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

3 participants