主机:Ubuntu 14.04.1 LTS,交叉编译器:arm-linux-gcc4.3.2。
tar jxf freetype-2.4.10.tar.bz2
cd freetype-2.4.10/
./configure --host=arm-linux
报错:
GNU make (>= 3.80) or makepp (>= 1.19) is required to build FreeType2.
Please try
`GNUMAKE=<GNU make command name> ./configure'.
or >&2
`GNUMAKE="makepp --norc-substitution" ./configure'.
解决方法: sudo apt-get install make
编译: make -j8
安装到当前目录的tmp目录: make DESTDIR=$PWD/tmp install
拷贝库文件和头文件到交叉编译器的lib和include目录:
cd tmp/usr/local/lib/
cp * /home/TQ2440/arm-linux-gcc/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/ -d -rf
cd ../include/
cp ft2build.h /home/TQ2440/arm-linux-gcc/4.3.2/arm-none-linux-gnueabi/libc/usr/include/
cp freetype2/* /home/TQ2440/arm-linux-gcc/4.3.2/arm-none-linux-gnueabi/libc/usr/include/ -rf
拷贝库文件到开发板的根文件系统的lib目录:
cd ../lib/
cp *so* /home/TQ2440/rootfs-yaffs2/lib -d -rf
由于app要用到汉字库文件HZK16和矢量字体文件,所以需要将HZK16和simsun.ttc拷贝到文件系统:
cd /home/TQ2440/
cp HZK16 rootfs-yaffs2/home/
cp simsun.ttc rootfs-yaffs2/home/
生成yaffs2镜像: ./mkyaffs2image rootfs-yaffs2/ rootfs.yaffs2,将文件系统烧写到开发板。
编译app: arm-linux-gcc show_font.c -o show_font -lfreetype -lm,报错:
show_font.c:4775:25: error: converting to execution character set: Invalid or incomplete multibyte or wide character
这是因为源码中用了宽字符集的原因,在编译时需要加上-finput-charset=GBK选项,重新编译: arm-linux-gcc show_font.c -o show_font -finput-charset=GBK -fexec-charset=GBK -lfreetype -lm
进入开发板终端:
cd home/
rz
chmod +x show_font
./show_font simsun.ttc 330
tar jxf freetype-2.4.10.tar.bz2
cd freetype-2.4.10/
./configure --host=arm-linux
报错:
GNU make (>= 3.80) or makepp (>= 1.19) is required to build FreeType2.
Please try
`GNUMAKE=<GNU make command name> ./configure'.
or >&2
`GNUMAKE="makepp --norc-substitution" ./configure'.
解决方法: sudo apt-get install make
编译: make -j8
安装到当前目录的tmp目录: make DESTDIR=$PWD/tmp install
拷贝库文件和头文件到交叉编译器的lib和include目录:
cd tmp/usr/local/lib/
cp * /home/TQ2440/arm-linux-gcc/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/ -d -rf
cd ../include/
cp ft2build.h /home/TQ2440/arm-linux-gcc/4.3.2/arm-none-linux-gnueabi/libc/usr/include/
cp freetype2/* /home/TQ2440/arm-linux-gcc/4.3.2/arm-none-linux-gnueabi/libc/usr/include/ -rf
拷贝库文件到开发板的根文件系统的lib目录:
cd ../lib/
cp *so* /home/TQ2440/rootfs-yaffs2/lib -d -rf
由于app要用到汉字库文件HZK16和矢量字体文件,所以需要将HZK16和simsun.ttc拷贝到文件系统:
cd /home/TQ2440/
cp HZK16 rootfs-yaffs2/home/
cp simsun.ttc rootfs-yaffs2/home/
生成yaffs2镜像: ./mkyaffs2image rootfs-yaffs2/ rootfs.yaffs2,将文件系统烧写到开发板。
编译app: arm-linux-gcc show_font.c -o show_font -lfreetype -lm,报错:
show_font.c:4775:25: error: converting to execution character set: Invalid or incomplete multibyte or wide character
这是因为源码中用了宽字符集的原因,在编译时需要加上-finput-charset=GBK选项,重新编译: arm-linux-gcc show_font.c -o show_font -finput-charset=GBK -fexec-charset=GBK -lfreetype -lm
进入开发板终端:
cd home/
rz
chmod +x show_font
./show_font simsun.ttc 330