Ubuntu-10.10下搭建DirectFB-1.6.1模拟环境

19 篇文章 0 订阅
2 篇文章 0 订阅

下载DirectFB与样例的源码包:

http://directfb.org/index.php?path=Main%2FDownloads

http://directfb.org/index.php?path=Main%2FDownloads&page=1

 

一、安装DirectFB

(1)解压安装

$sudo tar zxvf DirectFB-1.6.1.tar.gz

(2)安装

$cd   DirectFB-1.6.1

$./configure

注:如果在./configure这步出现下面的提示:

PNG support is missing - many applications won't work correctly!

JPEG support is missing - many applications won't workcorrectly!

FreeType2 support is missing - many applications won't workcorrectly!

       参考解决方法:

 $apt-cache search libpng

 $apt-get install libpng12-dev

$apt-cache search libjpeg

$apt-get install libjpeg62-dev

$apt-cache search libfreetype

$apt-get install libfreetype6-dev

apt-get install libfreetype

注:安装上述包后还需在再配置   $ ./configure

$sudomake

$sudomake install

二、安装DirectFB-examples-1.2.0

(1)下载解压

$sudotar zxvf DirectFB-examples-1.2.0.tar.gz

(2)安装

A:更新数据库

root@/home/dyf/DirectFB-1.6.1#updatedb

B:找到directfb.pc的路径,让其能找到对应的directfb

root@/home/dyf/DirectFB-1.6.1#locate directfb.pc

/home/dyf/DirectFB-1.6.1/directfb.pc

/home/dyf/DirectFB-1.6.1/directfb.pc.in

/root/DirectFB-1.6.1/directfb.pc.in

/usr/local/lib/pkgconfig/directfb.pc

C:设置环境

将上一步得到的pkgconfig库目录加入环境之中:

$export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

(这样只能在当前终端可以运行,关机后还得自已运行些命令,才能运行dfb程序,如 要永久性加入可这样:

可以$sudo vim /root/.profile中加入:PKG_CONFIG_PATH=/usr/local/lib/pkgconfig )

 

D:安装

$./configure

$  sudo make

$  sudo make install

 

E: 指定directfb的库目录

$ sudo vim /etc/ld.so.conf 在最后一行加入:/usr/local/lib,保存退出。

$ldconfig

 

F:运行测试样例

# cdDirectFB-examples-1.6.0/src

$sudodf_andi

如果没有通过且出现错误提示:

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.6.1|~~~~~~~~~~~~~~~~~~~~~~~~~~

        (c) 2001-2012  The world wide DirectFB Open Source Community

        (c) 2000-2004  Convergence (integrated media) GmbH

     ----------------------------------------------------------------

 

(*)DirectFB/Core: Single Application Core. (2012-08-08 07:26)

(*)Direct/Thread: Started 'Fusion Dispatch' (-1) [MESSAGING OTHER/OTHER 0/0]<8388608>...

(!)Direct/Util: Opening '/dev/fb0' and '/dev/fb/0' failed!

    --> The specified file has not beenfound

(!)DirectFB/FBDev: Error opening framebuffer device!

(!)DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.

(!)DirectFB/Core: Could not initialize 'system_core' core!

    --> A general initialization erroroccured

df_andi.c<472>:

(#) DirectFBError [DirectFBCreate( &dfb )]: A generalinitialization error occured

上面过程中可能出现framebuffer没有启动的问题,需要在ubuntu中配置以让其启动framebuffer支持。

 

方法:

在当前用户的主目录下(如以root身份登录的则是/root/)建立一个文件:.directfbrc,然后将如

下内容添加到该文件中:

最后,保存退出,这下再运行程序就可以看到程序正常运行了!

mode=1024x768

wm=default

depth=32

system=x11

注:

如果没有安装x11则需要安装

$ apt-get install xorg-dev

编译DFB程序的方法类似于:

gcc -I/usr/local/include -I/usr/local/include/directfb-I/usr/local/include/directfb-internal -L/usr/local/lib -ldirectfb -lpthread-ldl -lz test.c -o test

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值