1、下载下面两个包并解压:
tar -xzf DirectFB-1.0.0.tar.gz
tar -xzf DirectFB-examples-1.0.0.tar.gz
2、安装DirectFB-1.0.0
cd /home/DirectFB-1.0.0
./configure
make
make install
注:如果在./configure这步出现下面的提示:
PNG support is missing - many applications won't work correctly!
JPEG support is missing - many applications won't work correctly!
FreeType2 support is missing - many applications won't work correctly!
我解决的方法是:
查找关于png方面的包:apt-cache search png
安装一些相关的包 apt-get install cl-png gimageview gif2png libclan2c2a-png libglpng libglpng-dev libimage-size-ruby1.8 libpng3-dev
然后再make,make install就可以通过了。不过后来我再找了下有libpng,libjpeg,freetype2等包,我想安装这些包应该就可以了。
3、安装DirectFB-examples-1.0.0
a).vi /boot/grub/menu.lst在kernel后面加上vga=0x0317(分辨率1024*768)或者vga=788(分辨率800*600)把frambuffer启动,如:
#****************start*************#
title Ubuntu, kernel 2.6.17-10-generic
root (hd0,6)
kernel /vmlinuz-2.6.17-10-generic root=/dev/sda8 ro quiet splash locale=zh_CN vga=0x0317
initrd /initrd.img-2.6.17-10-generic
quiet
savedefault
boot
#****************stop**************#
b).updatedb #更新数据库
c).locate directfb.pc
找到directfb.pc的路径,例如我的是这样的:
/usr/lib/pkgconfig/directfb.pc
/usr/lib/pkgconfig/cairo-directfb.pc
/usr/local/lib/pkgconfig/directfb.pc
/data/soft/DirectFB-1.1.0/directfb.pc.in
/data/soft/DirectFB-1.1.0/directfb.pc
d).接着设置环境,将第3步得到的pkgconfig库目录加入环境之中:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
(这样只能在当前终端可以运行,关机后还得自已运行些命令,才能运行dfb程序,如要永久性加入可这样:
如你用的是root用户,可以vi /root/.profile中加入:
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig )
e).make
f).make install
g).将指定directfb的库目录:
vi /etc/ld.so.conf在最后一行加入:/usr/local/lib,保存退出。
ldconfig
h).重启计算机。 如果不重启,我的机子出现下面的错误:
(*) DirectFB/Core: Single Application Core. (2007-10-22 15:48)
(!) Direct/Util: opening '/dev/fb0' failed
--> No such device
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: Could not initialize 'system_core' core!
--> Initialization error!
df_andi.c <462>:
(#) DirectFBError [DirectFBCreate( &dfb )]: Initialization error!
4、测试例子,cd DirectFB-examples-1.0.0/src/ 下,运行:
./df_andi
安装完成!
阅读(3420) | 评论(0) | 转发(0) |