今日编译mipsel-linux的DirectFb碰壁及解决

今日无事,尝试编译DirectFb,使用的工具是君正的交叉编译工具,http://www.ingenic.cn/product.aspx?ID=62

使用库有:

jpeg-6b

freetype-2.5.0.1

DirectFB-1.7.0

步骤如下:

export PREFIX=/opt/mipsel
export LD_LIBRARY_PATH=$PREFIX/lib
export PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig
export ARCH=mips
export CROSS_COMPILE=/opt/mipseltools-gcc412-glibc261/bin/mipsel-linux-
export CC=${CROSS_COMPILE}gcc 
export CXX=${CROSS_COMPILE}g++ 
export AR=${CROSS_COMPILE}ar
export RANLIB=${CROSS_COMPILE}ranlib 
export NM=${CROSS_COMPILE}nm 
export AS=${CROSS_COMPILE}as
export LD=${CROSS_COMPILE}ld

cd jpeg-6b
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux
make
make install

cd freetype-2.5.0.1
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux
make
make install

这两步之有个小问题,make install 时提示有些目录不存在,比如/opt/man,手动创建再make install 一些就可以了。

cd DirectFB-1.7.0
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux --disable-x11 --with-gfxdrivers=none --enable-png=no "CFLAGS=-I/opt/mipsel/include"
make
问题来了
make[4]: Entering directory `/opt/directfb/DirectFB-1.7.0/lib/direct'
  CXX    String.lo
String.h:124: error: format string argument not a string type
String.h:129: error: format string argument not a string type
make[4]: *** [String.lo] 错误 1
make[4]: Leaving directory `/opt/directfb/DirectFB-1.7.0/lib/direct'
make[3]: *** [all-recursive] 错误 1
make[3]: Leaving directory `/opt/directfb/DirectFB-1.7.0/lib/direct'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory ``/opt/directfb/DirectFB-1.7.0/lib'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/opt/directfb/DirectFB-1.7.0'
make: *** [all] 错误 2

/opt/directfb/是我存放源码的目录。
打开/opt/directfb/DirectFB-1.7.0/lib/direct/目录下String.h,找到124行到129行,内容如下:
     PrintF( const _CharT *format, ... )          D_FORMAT_PRINTF(2);

     StringBase &
     PrintF( const _CharT *format, va_list args, size_t stack_buffer = 300 );

     static StringBase F( const _CharT *format, ... ) D_FORMAT_PRINTF(1);
由于提示的错误是format string argument not a string type,说明参数format的类型必须是字符串类型(带点经验的猜测),所以修改如下:
     PrintF( const char *format, ... )          D_FORMAT_PRINTF(2);

     StringBase &
     PrintF( const char *format, va_list args, size_t stack_buffer = 300 );

     static StringBase F( const char *format, ... ) D_FORMAT_PRINTF(1);
搞定
make
通过
make install
搞定

还没实际在板上跑。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值