简体   繁体   English

在 Windows 上使用 MinGW-w64 编译 ICU 的问题

[英]Problems with compilation ICU with MinGW-w64 on Windows

I tried to compile ICU 59.1 with MinGW-w64 according to Qt manual ( MinGW-64-bit ).我尝试根据 Qt 手册( MinGW-64 位)使用 MinGW-w64 编译 ICU 59.1。 Unfortunately, I got the following error:不幸的是,我收到以下错误:

$ make && make install
rebuilding config/icucross.mk
rebuilding config/icucross.inc
cd ./config; \
        make -f pkgdataMakefile
make[1]: вход в каталог «/c/Qt-deps/icu-59_1/source/config»


*** ERROR - configure could not detect your platform
*** see the readme.html
*** or, try copying icu/source/config/mh-linux to mh-unknown
***   and editing it.


exit 1
rm -rf pkgdata.inc
make[1]: выход из каталога «/c/Qt-deps/icu-59_1/source/config»
rm -rf config/icu-config
/usr/bin/install -c ./config/icu-config-top config/icu-config
chmod u+w config/icu-config
LC_ALL=C /usr/bin/sed -f ./config/make2sh.sed < ./config/Makefile.inc | grep -v '#M#' | uniq >> config/icu-config
LC_ALL=C /usr/bin/sed -f ./config/make2sh.sed < ./config/mh-unknown | grep -v '#M#' | uniq >> config/icu-config
cat ./config/icu-config-bottom >> config/icu-config
chmod u-w config/icu-config
config/icu-uc.pc updated.
config/icu-i18n.pc updated.
config/icu-io.pc updated.
Note: rebuild with "make VERBOSE=1 " to show all compiler parameters.
/bin/sh ./mkinstalldirs lib
mkdir lib
/bin/sh ./mkinstalldirs bin
mkdir bin
make[0]: Making `all' in `stubdata'
make[1]: вход в каталог «/c/Qt-deps/icu-59_1/source/stubdata»


*** ERROR - configure could not detect your platform
*** see the readme.html
*** or, try copying icu/source/config/mh-linux to mh-unknown
***   and editing it.


exit 1
make[1]: выход из каталога «/c/Qt-deps/icu-59_1/source/stubdata»
make: *** [Makefile:147: all-recursive] Ошибка 2

I have tried to compile it twice on two different computers: the 1st one - Windows 10 Pro, the last one - Windows 7 Ultimate.我试图在两台不同的计算机上编译它两次:第一台 - Windows 10 Pro,最后一台 - Windows 7 Ultimate。 Results are the same.结果是一样的。 Used tools: MSYS2 x64 (20161025).使用的工具:MSYS2 x64 (20161025)。 So, what am I doing wrong?那么,我做错了什么?

The error "configure could not detect your platform" can probably be fixed by passing the arguments --build=$MINGW_CHOST --host=$MINGW_CHOST to the configure script.错误“configure could not detect your platform”可能可以通过将参数--build=$MINGW_CHOST --host=$MINGW_CHOST传递给配置脚本来修复。 If you are in the right type of MSYS2 shell, $MINGW_CHOST should be i686-w64-mingw32 or x86_64-w64-mingw32如果您使用的是正确类型的 MSYS2 shell, $MINGW_CHOST应该是i686-w64-mingw32x86_64-w64-mingw32

For more useful tips for building ICU, look at the build script that the MSYS2 developers have crafted:有关构建 ICU 的更多有用提示,请查看 MSYS2 开发人员制作的构建脚本:

https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-icu https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-icu

I have fixed the same issue (except that used ICU 55.1) replacing ../source/config/mh-unknown with the contents of ../source/config/mh-mingw64我已经解决了同样的问题(除了使用 ICU 55.1)用../source/config/mh-mingw64的内容替换../source/config/mh-unknown

I have build icu with same problem.我用同样的问题构建了 icu。 I have run this script for correct the problem:我已经运行此脚本来纠正问题:

del M:\work\code\qt\icu4c-68_2\icu4c\source\config\mh-unknow
copy M:\work\code\qt\icu4c-68_2\icu4c\source\config\mh-msys-msvc M:\work\code\qt\icu4c-68_2\icu4c\source\config\mh-unknow

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM