交叉编译fbv图片浏览器

作者:帅得不敢出门    C++哈哈堂群31843264  转载请保留此信息

到官网http://freshmeat.net/projects/fbv/下载最新的fbv源码,fbv-0.99.tar.gz

 

http://sourceforge.net/projects/giflib/下载giflib

http://www.libpng.org/pub/png/libpng.html下载  libpng

 

我是没有 选择x11选项的

tar -xvf giflib-4.1.6.tar.bz2
cd giflib-4.1.6/

CC=$arm-linux-gcc  ./configure --prefix=/usr/local/arm/arm412 --host=$arm-linux --without-x --disable-x11

make

sudo make install

 

libpng编译方法差不多的,略。

 

tar -xvf fbv-0.99.tar.gz

cd   fbv-0.99

 

make CC="arm-linux-gcc -O2 -Wall -I/usr/local/arm/arm412/include" LIB="-L/usr/local/arm/arm412/lib -lgif -ljpeg -lpng14"

 

出错:

In file included from /opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/stdlib.h:438,
                 from fb_display.c:22:
/opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/sys/types.h:62: error: conflicting types for ‘dev_t’
/opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/linux/types.h:13: error: previous declaration of ‘dev_t’ was here
/opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/sys/types.h:67: error: conflicting types for ‘gid_t’
/opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/linux/types.h:27: error: previous declaration of ‘gid_t’ was here
/opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/sys/types.h:72: error: conflicting types for ‘mode_t’
/opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/linux/types.h:15: error: previous declaration of ‘mode_t’ was here
/opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/sys/types.h:77: error: conflicting types for ‘nlink_t’
/opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/linux/types.h:16: error: previous declaration of ‘nlink_t’ was here
/opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/sys/types.h:82: error: conflicting types for ‘uid_t’
/opt/toolchains/arm920t-eabi/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/include/linux/types.h:26: error: previous declaration of ‘uid_t’ was here

 

解决方法修改fb_display.c 把#include <sys/types.h> 放到最前面。

再编译,就可以过了。

arm-linux-gcc -O2 -Wall -I/usr/local/arm/arm412/include  -o fbv main.o jpeg.o gif.o png.o bmp.o fb_display.o resize.o -L/usr/local/arm/arm412/lib -lgif -ljpeg -lpng14
Build DONE.

 

你可能感兴趣的:(c,浏览器,File,Build,Types)