移植QT到QNX,QNX开发QT程序,QT图形开发环境搭建

来源:互联网 发布:js中window事件 编辑:程序博客网 时间:2024/05/16 16:55

锋影

e-mail:174176320@qq.com


根据QT主页上提供的参数,修改4个地方。

./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-x86-qcc \

     -little-endian -arch i386 -largefile -nomake examples -nomake demos -xmlpatterns -no-webkit \

     -no-rpath -opengl es2 -reduce-exports -system-sqlite

1.-xplatform mkspecs/qws/qnx-arm-g++

2.-arch arm

3.添加 -continue

4.去掉-opengl es2, 换成-no-opengl -no-openssl -noopenvg

修改后的命令为:

./configure -opensource -confirm-license -qpa -shared -release -xplatform qws/qnx-arm-g++ -little-endian -arch arm -largefile -xmlpatterns -no-webkit  -no-rpath -reduce-exports -system-sqlite -continue  -no-openssl -no-openvg


gmake
编译,make install 安装。

中间会碰到几个编译错误,注释掉src/plugins/platforms/plaforms.pro中关于编译blackberry的地方就行,我们用不着编译blackberry的程序。

安装完成后导出安装后的QT目录,如:

export PATH=/usr/local/Trolltech/qt-opensource-4.8.4-arm/bin:$PATH

使用qtcreator建立一个helloworld程序,进入目录里,在main.cpp中加入

 qDebug(hello, world!\n);

进入并使用我们自己编译出来的qmake编译程序。

将程序拷贝到目标板,运行,会提示需要什么库,然后从交叉编译的工具库中拷贝库文件过去,注意:使用原始的libQtCore.so.4.8.4这样的文件,而不是一个链接libQtCore.so.4。

然后在目标板设置导出LD_LIBRARY_PATH.并自己建立动态库的符号链接。

运行打印hello, world.,说明已经移植成功。


原创粉丝点击