Windows 10上的LibPNG构建问题 [英] LibPNG building issue on Windows 10
问题描述
我正在尝试在Windows 10上构建libpng以获取win32二进制文件,但是我认为与awk解析具有CRLF行尾的文件有关.我尝试使用dos2unix命令转换文件,但没有成功,结果相同-在make命令中,我得到下一个输出:
Im trying to build libpng on Windows 10 to get win32 binaries but having an issue related, i supposed, to awk parsing files with CRLF line endings. I've tried to convert files with dos2unix command, but without success, result the same - on the make command I've getting next output:
sh-3.1$ make
rm -f pnglibconf.c pnglibconf.tf[45]
gawk -f ./scripts/options.awk out=pnglibconf.tf4 version=search\
./pngconf.h ./scripts/pnglibconf.dfa\
./pngusr.dfa 1>&2
gawk -f ./scripts/options.awk out=pnglibconf.tf5 pnglibconf.tf4 1>&2
options.awk: bad line (10): com
make: *** [pnglibconf.c] Error 1
在Windows 10 x86上,编译器为MinGW,带有MSYS v1.0,libpng版本为1637.如何解决此问题?
Compiler is MinGW with MSYS v1.0 on WIndows 10 x86, libpng version is 1637. How to solve this issue?
更新:通过下载tar.gz归档文件解决,但有新问题
Update: solved by downloading tar.gz archive, but having new issue
sh-3.1$ make make all-am make[1]: Entering directory `/c/Users/user/Downloads/libpng-1.6.37.tar/libpng-1.6.37' depbase=`echo contrib/tools/pngfix.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -g -O2 -MT contrib/tools/pngfix.o -MD -MP -MF $depbase.Tpo -c -o contrib/tools/pngfix.o contrib/tools/pngfix.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from contrib/tools/../../png.h:330,
from contrib/tools/pngfix.c:44:
contrib/tools/../../pnglibconf.h:206:54: error: expected identifier or '(' before '-' token
#define PNG_TEXT_Z_DEFAULT_STRATEGY 0
^
In file included from contrib/tools/../../png.h:335,
from contrib/tools/pngfix.c:44:
contrib/tools/../../pngconf.h:524:9: error: unknown type name 'ptrdiff_t'
typedef ptrdiff_t png_ptrdiff_t;
^~~~~~~~~
make[1]: *** [contrib/tools/pngfix.o] Error 1 make[1]: Leaving directory `/c/Users/user/Downloads/libpng-1.6.37.tar/libpng-1.6.37' make: *** [all] Error 2
已经通过实验验证,在Linux上不会发生此问题.
It has been experimentally verified that this problem does not occur on Linux.
推荐答案
已解决.摘要:将tar.gz或xz存档与unix LF一起使用,并编辑在编译过程中生成的pnglibconf.h,因此没有换行符.
Solved. Summary: use tar.gz or xz archive with unix LF, and edit pnglibconf.h generated during compilation so there is no line breaks.
这篇关于Windows 10上的LibPNG构建问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!