Chinaunix首页 | 论坛 | 博客
  • 博客访问: 39282
  • 博文数量: 11
  • 博客积分: 20
  • 博客等级: 民兵
  • 技术积分: 42
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-22 09:55
文章分类
文章存档

2017年(2)

2016年(2)

2015年(1)

2012年(6)

我的朋友

分类: LINUX

2017-03-29 23:56:41

原文地址:移植Qt_for_ARM出错小结 作者:drobols

移植Qt_for_ARM

20121027

21:03

[root@localhost qtARM]# ./configure -prefix /usr/local/qtARM/ -embedded arm -xplatform qws/linux-arm-g++ -qt-libtiff -qt-libmng -qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib

Which edition of Qt do you want to use ?

 

Type 'c' if you want to use the Commercial Edition.

Type 'o' if you want to use the Open Source Edition.

o

 

问题一:

You have not explicitly asked to use pkg-config and are cross-compiling.

pkg-config will not be used to automatically query cflag/lib parameters for

Dependencies

 

 

解决:

步骤一:其实加个参数就可以了,第一个提示说你没有使用PKG-CONFIG功能,第二个提示是你给你库位置有问题。如果你已经安装了pkg-config,可以使用命令 which pkg-config,查看是否有安装。

然后在./configure添加一句命令 -force-pkg-config,提示使用pkg-config功能。

步骤二:

输入:

./configure -force-pkg-config -prefix /usr/local/qtARM/ -embedded arm -xplatform qws/linux-arm-g++ -qt-libtiff -qt-libmng -qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib

 

问题二:

warning:

You have not explicitly asked to use pkg-config and are cross-compiling.

pkg-config will not be used to automatically query cflag/lib parameters for

dependencies

 

解决办法:编qt/e库前必需把tslib库路径加入当前环境变量PKG_CONFIG_PATH和LD_LIBRARY_PATH中,如下面所示(主要为了获取.pc文件?root@localhost tslib]# ls lib/pkgconfig/

tslib-0.0.pc)

 

输入:

export TSLIB_ROOT=/usr/local/tslib

export PKG_CONFIG_PATH=$TSLIB_ROOT/lib/pkgconfig:$PKG_CONFIG_PATH

export LD_LIBRARY_PATH=$TSLIB_ROOT/lib:$LD_LIBRARY_PATH

 

如此才可编译出可连接tslib库的QT/E库

 

 

pkg-config的使用

 

 

重新配置:

./configure -force-pkg-config -prefix /usr/local/qtARM/ -embedded arm -xplatform qws/linux-arm-g++ -qt-libtiff -qt-libmng -qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib

提示警告:

Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not

been set. This means your toolchain's .pc files must contain

the paths to the toolchain's libraries & headers. If configure

tests are failing, please check these files.

这里我直接跳过了,后面成功了。

 

配置通过。

 

 

 

总结configure,pkg-config和PKG_CONFIG_PATH

 

.pc文件

pc(package configure)是包(库)配置文件,保存在PKG_CONFIG_PATH=/usr/gpephone//lib/pkgconfig::/usr/lib/pkgconfig。pc文件保存了该库的头文件、库所在的路径信息。GCC等编译器编译时,比如编译某个工程用到glib-2.0这个库,pkg-config会按照PKG_CONFIG_PATH中的路径进行搜索glib-2.0.pc,然后把lib-2.0.pc作为参数传给GCC,那么GCC就可以找到该库了。

 

需要重新设置 PKG_CONFIG_PATH 和LD_LIBRARY_PATH 环境变量

 

理解 pkg-config 工具,

 

 

 

设置环境变量

vim ~/.setenv-qtARM.sh

 

export PATH=/usr/local/qtARM/bin:$PATH

 

export QTEDIR=/usr/local/qtARM/

 

export LD_LIBRARY_PATH=/usr/local/qtARM/lib:$LD_LIBRARY_PATH

 

export QMAKESPEC=/usr/local/qtARM/mkspecs/qws/linux-arm-g++//这么设置使得在make时能通过,并成功下载到开发板使用。

                                                         

 

 

4.4.1交叉编译动态库:/4.4.1/arm-none-linux-gnueabi/libc/lib

 

 

我的4.4.1交叉编译器的libstdc.so*在下面目录:

/4.4.1/arm-none-linux-gnueabi/libc/usr/lib

阅读(1894) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~