DirectFB 之 环境配置

本文详细介绍了DirectFB图形库的安装步骤,包括所需依赖库的安装、环境变量的配置及示例程序的编译运行过程。针对安装过程中常见的错误提供了具体的解决办法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 准备

本人采用的版本是DirectFB-1.5.3.tar.gz

2. 安装

1. 安装PNG、JPEG、FreeType2 support
#apt-get install libpng-devel  
#apt-get install libjpeg-devel  
#apt-get install freetype-devel   
1. 解压  
tar -xvf DirectFB-1.2.8.tar.gz  
tar -xvf DirectFB-examples-1.2.0.tar.gz   
  
2. 编译DFB   
#cd DirectFB-1.5.3
#./configure  
#make  
#make instal
注:DFB(./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!
    解决的方法可以参考:
    (1)输入命令:
        apt-cache search libpng
        apt-cache search libjpeg
        apt-cache search libfreetype
        或  aptitude search  libfreetype
    (2) 根据提示安装

3. 配置环境变量
    如果不更新环境变量,可能无法正常编译下面的例子   
# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig  
建议最好将将以上环境变量添加到自己的 bash profile 中,例如 root 用户可以修改 /root/.bash_profile加入:
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
    指定directfb的库目录,如果不做这一步骤,无法正常运行,在/etc/ld.so.conf最后一行加入以下代码:/usr/local/lib,然后执行ldconfig。
    或者是设置环境变量:export LD_LIBRARY_PATH=/usr/local/lib  

4. 示例检查   
#cd ..  
#cd DirectFB-examples-1.2.0  
#./configure  
#make   
#make install  
运行例子   
#./df_window
注:
/usr/include/x86_64-linux-gnu/sys/param.h:76:0: note: this is the location of the previous definition
df_dok.c:311:13: error: conflicting types for ‘shutdown’
/usr/include/x86_64-linux-gnu/sys/socket.h:232:12: note: previous declaration of ‘shutdown’ was here
make[2]: *** [df_dok.o] Error 1
解决方法:
     改名字


 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YoungerChina

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值