【问题】
折腾:
【记录】Cygwin下用arm-xscale-linux-gnueabi交叉编译libhttpd
期间,编译出错:
CLi@PC-CLI-1 ~/develop/libhttpd/lighttpd-1.4.32 $ make make all-recursive make[1]: Entering directory `/home/CLi/develop/libhttpd/lighttpd-1.4.32' Making all in src make[2]: Entering directory `/home/CLi/develop/libhttpd/lighttpd-1.4.32/src' make all-am make[3]: Entering directory `/home/CLi/develop/libhttpd/lighttpd-1.4.32/src' /bin/sh ../libtool --tag=CC --mode=compile arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -DHAVE_VERSION_H -DLIBRARY_DIR="\"/home/CLi/develop/crosstool-ng/x-tools/armxscalelibhttpd/lib\"" -DSBIN_DIR="\"/home/CLi/develop/crosstool-ng/x-tools/armxscalelibhttpd/sbin\"" -I. -I.. -D_REENTRANT -D__EXTENSIONS__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -g -O2 -Wall -W -Wshadow -pedantic -std=gnu99 -MT mod_flv_streaming.lo -MD -MP -MF .deps/mod_flv_streaming.Tpo -c -o mod_flv_streaming.lo mod_flv_streaming.c libtool: compile: arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -DHAVE_VERSION_H -DLIBRARY_DIR=\"/home/CLi/develop/crosstool-ng/x-tools/armxscalelibhttpd/lib\" -DSBIN_DIR=\"/home/CLi/develop/crosstool-ng/x-tools/armxscalelibhttpd/sbin\" -I. -I.. -D_REENTRANT -D__EXTENSIONS__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -g -O2 -Wall -W -Wshadow -pedantic -std=gnu99 -MT mod_flv_streaming.lo -MD -MP -MF .deps/mod_flv_streaming.Tpo -c mod_flv_streaming.c -fPIC -DPIC -o .libs/mod_flv_streaming.o In file included from base.h:24:0, from mod_flv_streaming.c:1: array.h:9:19: fatal error: pcre.h: No such file or directory compilation terminated. Makefile:1203: recipe for target `mod_flv_streaming.lo' failed make[3]: *** [mod_flv_streaming.lo] Error 1 make[3]: Leaving directory `/home/CLi/develop/libhttpd/lighttpd-1.4.32/src' Makefile:851: recipe for target `all' failed make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/CLi/develop/libhttpd/lighttpd-1.4.32/src' Makefile:364: recipe for target `all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/CLi/develop/libhttpd/lighttpd-1.4.32' Makefile:293: recipe for target `all' failed make: *** [all] Error 2
即:
array.h:9:19: fatal error: pcre.h: No such file or directory |
找不到pcre.h文件。
【解决过程】
1.参考:
how to cross compile lighttpd with pcre support
得知,需要去添加pcre才可以。
但是此处,没有交叉编译好的pcre。
2. 然后去交叉编译pcre:
【记录】cygwin下用arm-xscale-linux-gnueabi交叉编译pcre
3.此处,先尝试make时添加各种参数,试试能否解决问题:
make CFLAGS=-I/home/CLi/develop/crosstool-ng/x-tools/armxscalepcre/include
结果是,真的就解决了此问题了:
CLi@PC-CLI-1 ~/develop/libhttpd/lighttpd-1.4.32 $ make CFLAGS=-I/home/CLi/develop/crosstool-ng/x-tools/armxscalepcre/include make all-recursive make[1]: Entering directory `/home/CLi/develop/libhttpd/lighttpd-1.4.32' Making all in src make[2]: Entering directory `/home/CLi/develop/libhttpd/lighttpd-1.4.32/src' make all-am make[3]: Entering directory `/home/CLi/develop/libhttpd/lighttpd-1.4.32/src' /bin/sh ../libtool --tag=CC --mode=compile arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -DHAVE_VERSION_H -DLIBRARY_DIR="\"/home/CLi/develop/crosstool-ng/x-tools/armxscalelibhttpd/lib\"" -DSBIN_DIR="\"/home/CLi/develop/crosstool-ng/x-tools/armxscalelibhttpd/sbin\"" -I. -I.. -D_REENTRANT -D__EXTENSIONS__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -I/home/CLi/develop/crosstool-ng/x-tools/armxscalepcre/include -MT mod_flv_streaming.lo -MD -MP -MF .deps/mod_flv_streaming.Tpo -c -o mod_flv_streaming.lo mod_flv_streaming.c libtool: compile: arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -DHAVE_VERSION_H -DLIBRARY_DIR=\"/home/CLi/develop/crosstool-ng/x-tools/armxscalelibhttpd/lib\" -DSBIN_DIR=\"/home/CLi/develop/crosstool-ng/x-tools/armxscalelibhttpd/sbin\" -I. -I.. -D_REENTRANT -D__EXTENSIONS__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -I/home/CLi/develop/crosstool-ng/x-tools/armxscalepcre/include -MT mod_flv_streaming.lo -MD -MP -MF .deps/mod_flv_streaming.Tpo -c mod_flv_streaming.c -fPIC -DPIC -o .libs/mod_flv_streaming.o mv -f .deps/mod_flv_streaming.Tpo .deps/mod_flv_streaming.Plo
【总结】
当交叉编译libhttpd出现:
fatal error: pcre.h: No such file or directory |
的错误时,是因为:
由于没有指定是否用pcre,所以使用的是默认使用pcre的:
(可以从:./configure –help中的:
–with-pcre Enable pcre support (default yes) |
看出来)
所以,此处是缺少了pcre。
解决办法:
先去交叉编译pcre,然后再在make的时候,加上对应的include路径
make CFLAGS=-I/home/CLi/develop/crosstool-ng/x-tools/armxscalepcre/include
即可。
其中,交叉编译pcre,可参考:
【记录】cygwin下用arm-xscale-linux-gnueabi交叉编译pcre
转载请注明:在路上 » 【已解决】Cygwin下用arm-xscale-linux-gnueabi交叉编译libhttpd出错:fatal error: pcre.h: No such file or directory