DirectFB 之 环境配置

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
解决方法:
     改名字


 

posted on   YoungerChina  阅读(826)  评论(0编辑  收藏  举报

编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示