Linux 下 Qt Embedded 4.6.2 嵌入式开发环境的搭建、移植(ubtuntu8.10)

1.tar jxvf arm-linux-gcc-3.4.1.tar -C /

vi /etc/profile    (这只是一个命令,并不需要找到这个文件)
<在Ubuntu 下执行 sudo vim /etc/profile>

最后一行加入:export PATH=/usr/local/arm/3.4.1/bin:$PATH

 保存退出后执行:
source /etc/profile

 

2.编译嵌入式arm版(需要 arm-linux-gcc 的支持):

编译tslib对触摸屏支持:

下载,tslib1.4.tar.gz,解压后:

cd tslib-1.4

export CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc   //指定交叉编译器

./autogen.sh   //生成config文件
错误现象:./autogen.sh: 9: autoreconf: not found
解决办法:#sudo apt-get install autoconf
错误现象:Can't exec "automake": 没有该文件或目录 at /usr/bin/autoreconf line 183
解决办法:#sudo apt-get install automake
错误现象:configure.ac:25: error: possibly undefined macro: AC_DISABLE_STATIC
解决办法:#sudo apt-get install libtool
      export PATH=/usr/local/arm/3.4.1/bin:$PATH

echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
     
     ./configure --prefix=/mnt/nfs/tslib1.4-install --host=arm-linux --cache-file=arm-linux.cache --enable-inputapi=yes

make

make install

 在/mnt/nfs里生成tslib1.4-install

3。安装qt-everywhere-opensource-src-4.6.2.tar.gz

进入解压目录:

运行

./configure -prefix /usr/local/QTE-4.6.2 -release -opensource -shared -no-largefile -no-qt3support /
-xplatform qws/linux-arm-g++ -embedded arm /
-qt-gif -qt-libpng -qt-libjpeg /
-iconv -little-endian -qt-freetype /
-depths 16,18,24,32 /
-no-dbus -qt-sql-sqlite -qt-kbd-qvfb -qt-kbd-tty -no-glib /
-qt-mouse-tslib /
-I /mnt/nfs/tslib1.4-install/include /
-L /mnt/nfs/tslib1.4-install/lib /
-D__ARM_ARCH_5TEJ__

成功后

make

 

出现错误

QFontEngineFT::init(QFontEngine::FaceId, bool, QFontEngineFT::GlyphFormat)':

text/qfontengine_ft.cpp:696: warning: initialization to `int' from `qreal'

text/qfontengine_ft.cpp:696: warning: argument to `int' from `qreal'

{standard input}: Assembler messages:

{standard input}:1587: Error: register or shift expression expected -- `orr r3,r2,lsl#16'

{standard input}:1597: Error: register or shift expression expected -- `orr r2,r3,lsl#16'

{standard input}:3206: Error: register or shift expression expected -- `orr r3,r1,lsl#16'

{standard input}:3219: Error: register or shift expression expected -- `orr r3,ip,lsl#16'

解决:参考http://www.qtcn.org/bbs/read.php?tid=24692&fpage=0&toread=&page=1  守望者的临时解决方案:

To fix this issue patch /src/3rdparty/freetype/include/freetype/config/ftconfig.h Line 330.

(原来的为)  "orr %0, %2, lsl #16/n/t" /* %0 |= %2 << 16 */

(修改后为)  "orr %0, %0, %2, lsl #16/n/t" /* %0 |= %2 << 16 */

之后经过漫长的等待出现下列错误

/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/bin/ld: warning: libts-0.0.so.0, needed by /root/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/root/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_close'
/root/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_config'
/root/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_read'
/root/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_read_raw'
/root/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_open'
/root/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_fd'
collect2: ld returned 1 exit status
解决办法:
修改qt-everywhere-opensource-src-4.6.0/mkspecs/qws/linux-arm-g++/qmake.conf 文件(添加lts参数):
QMAKE_CC                = arm-linux-gcc -lts
QMAKE_CXX               = arm-linux-g++ -lts
QMAKE_LINK              = arm-linux-g++ -lts
QMAKE_LINK_SHLIB        = arm-linux-g++ -lts

参考:http://74.125.153.132/search?q=cache:3WzcJeRRj4sJ:nckuhuahua.pixnet.net/blog/post/30066956+libQtGui.so:+undefined+reference+to+%60ts_read%27&cd=3&hl=en&ct=clnk&client=iceweasel-a
又经过漫长的时间,成功结束

接下来是make install

在ubtuntu上编译成功 说明编译的库可用。然后把lib下载到试验箱上,运行成功

 

 

你可能感兴趣的:(Linux 下 Qt Embedded 4.6.2 嵌入式开发环境的搭建、移植(ubtuntu8.10))