T3 Embedded 编译过程中出错的解决方法

来源:互联网 发布:网络童装代理 编辑:程序博客网 时间:2024/04/28 20:35

 

 

 

QT3 Embedded 编译过程中出错的解决方法

参数配置

./configure -embedded arm -xplatform qws/linux-arm-g++  -static -depths 4,8,16,32 -thread  -qt-mouse-bus -qt-mouse-pc -no-cups -qt-gif

注意:在configure的时候会出现一个警告

WARNING: Failure to find: .moc/release-static-mt-emb-x86/allmoc.cpp

关于这个问题官方已经给出答案,引用如下

This is not a problem. It happens everytime Qt/embedded is configured.

所以,这个警告可以不预理会。

错误1../include/qstring.h: In member function 'ushort& QChar::unicode()':

../include/qstring.h:199: error: cannot bind packed field

'((QChar*)this)->QChar::ucs' to 'ushort&'

解决办法:

打开src/tools/qglobal.h查找278行,开始修改,红色部分为修改内容

# if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)

# define Q_PACKED __attribute__ ((packed))

# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4

# define Q_NO_PACKED_REFERENCE

# endif

# if __GNUC__ == 4 && __GNUC_MINOR__ >= 0

# define Q_NO_PACKED_POINTERS

# endif

# endif

# if !defined(__EXCEPTIONS)

# define Q_NO_EXCEPTIONS

# endif

 

打开include/qstring.h查看185

修改如下:

ushort unicode() const { return ucs; }

#ifdef Q_NO_PACKED_REFERENCE

ushort &unicode() { return *(&ucs); }

#elif defined Q_NO_PACKED_POINTERS

ushort &unicode() { ushort &tmp = ucs; return tmp; }

#else

ushort &unicode() { return ucs; }

#endif

#ifndef QT_NO_CAST_ACSII

 

错误2

qsortedlist.h:52: error: there are no arguments to 'clear' that depend on a template parameter, so a declaration of 'clear' must be available

解决方法:打开include/qsortedlist.h

52行改为:~QsortedList() {this->clear();}

错误3

dialogs/qprintdialog.cpp:766:23: error: cups/cups.h: No such file or directory

解决方法:在参数配置时 加上 –no-cups

错误4

launcher.cpp:158: error: missing terminating " character

解决方法:打开example/launcher/launcher.cpp

字符串换行后,在编译时错误,把字符串调整到一行就可以了。

错误5

embedded/qgfxvfb_qws.cpp:292: error: 'gfx_screen' was not declared in this scope

解决方法:把gfx_screen改为this->gfx_screen,原因是用高版本的gcc编译低版本的qt就会出这样的问题。类似这个没有声明的错误在前面加this->就可以了。

 

接下来就是make clean

make

我们先来查看文件信息:

[root@localhost lib]# file libqte-mt.so.3.3.8

libqte-mt.so.3.3.8: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), not stripped

此时显示的是not stripped,即没有经过strip

[root@localhost lib]# arm-none-linux-gnueabi-strip libqte-mt.so.3.3.8

执行strip命令之后我们再次查看文件信息:

[root@localhost lib]# file libqte-mt.so.3.3.8

libqte-mt.so.3.3.8: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), stripped

此时显示的是stripped,即已经strip。你会发现,strip之后libqte-mt.so.3.3.8发生明显变化的,不过在实际的开发过程中,我们是不提倡这样做的,因为使用strip,使用gdb时就无法获得调试信息了。故,在开发过程,我们为了方便以后的调试最好不要strip

后记:因为是初步交*编译,所以触摸屏支持和字体库的添加,中文支持,如何添加wenquanyi字体等等,还有库的裁减都没有具体实现,不过完成后我会继续写出来,与大家分享!另外,很多地方我懒得注释,因为很多知识都是交*编译的基础只是,请读者自己理解!这也是一个学习的过程。

 

 

 

原创粉丝点击