安装方法:把qt-x11-2.3.2.tar.gz放到/home下
sudo tar vxzf qt-x11-2.3.2.tar.gz
cd qt-x11-2.3.2
export QTDIR =/home/qt-x11-2.3.2
./configure -help
sudo ./configure -platform linux-g++ -thread -system-jpeg -gif -no-xft
sudo make
qt/embedded安装
不是交叉编译时: sudo ./configure -xplatform linux-x86-g++ -thread -qvfb
典型错误如下:
xml/qxml.cpp:2502: instantiated from here
/usr/local/arm/QT/qt-2.3.7/include/qvaluestack.h:57: error: cannot convert ‘QValueListIterator<QString>’ to ‘const char*’ for argument ‘1’ to ‘int remove(const char*)’
make[2]: *** [xml/qxml.o] 错误 1
make[2]: Leaving directory `/usr/local/arm/QT/qt-2.3.2/src'
make[1]: *** [sub-src] 错误 2
make[1]: Leaving directory `/usr/local/arm/QT/qt-2.3.2'
make: *** [init] 错误 2
这个错误是说,在文件qvaluestack.h的57行出错。改正方法是修改文件qt-2.3.7/src/tools/qvaluestack.h的 第57行,将remove( this->fromLast() );改为this->remove( this->fromLast () );
修改时可能要更改文件权限,变成可写的,虽然在错误信息里qvaluestack.h文件是在qt-2.3.7/include/下,但要修改的文件要在qt-2.3.7/src/下找,不在kernel里就在tools里。
还有一个典型错误是说,
在文件qwindowsystem_qws.h中缺少一个叫做QWSInputMethod的类,修改方法为修改文件qt-2.3.7/src/kernel/qwindowsystem_qws.h,增加一个类class QWSInputMethod;
我最头疼的一个错误
/root/2410/qt-2.3.7/include/qsortedlist.h: In destructor `QSortedList<type>::~QSortedList()':
/root/2410/qt-2.3.7/include/qsortedlist.h:51: error: there are no arguments to `clear' that depend on a template parameter, so a declaration of `clear' must be available
/root/2410/qt-2.3.7/include/qsortedlist.h:51: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
make[2]: *** [allmoc.o] 错误 1
make[2]: Leaving directory `/root/2410/qt-2.3.7/src'
make[1]: *** [sub-src] 错误 2
make[1]: Leaving directory `/root/2410/qt-2.3.7'
make: *** [init] 错误 2
这个错误是说,在文件qsortedlist.h的第51行,clear没有声明,不可用,原代码在qt-2.3.7/src/tools/下,51行是 ~QSortedList() { clear(); },我猜把它改成~QSortedList() { },或者 ~QSortedList() {int clear(); },都可以make通过。但不知道有没有隐患。
kernel/qgfxraster_qws.cpp:5631: instantiated from here
kernel/qgfxraster_qws.cpp:3635: 警告:提领类型双关的指针将破坏强重叠规则
kernel/qgfxraster_qws.cpp:3708: 警告:提领类型双关的指针将破坏强重叠规则
kernel/qgfxraster_qws.cpp:3831: 警告:提领类型双关的指针将破坏强重叠规则
kernel/qgfxraster_qws.cpp:3849: 警告:提领类型双关的指针将破坏强重叠规则
kernel/qgfxraster_qws.cpp:4119: 警告:‘myptr’ 上的运算结果可能是未定义的
make[3]: *** [kernel/qgfxraster_qws.o] 错误 1
make[3]: Leaving directory `/home/qte-2.3.2/src'
make[2]: *** [src-mt] 错误 2
make[2]: Leaving directory `/home/qte-2.3.2'
make[1]: *** [src-mt] 错误 2
make[1]: Leaving directory `/home/qte-2.3.2'
make: *** [init] 错误 2
把*myptr++ = (*myptr & 0x0f)改为int *myptr++ = (*myptr & 0x0f)
ernel/qgfxraster_qws.cpp:5631: instantiated from here
kernel/qgfxraster_qws.cpp:3635: 警告:提领类型双关的指针将破坏强重叠规则
kernel/qgfxraster_qws.cpp:3708: 警告:提领类型双关的指针将破坏强重叠规则
kernel/qgfxraster_qws.cpp:3831: 警告:提领类型双关的指针将破坏强重叠规则
kernel/qgfxraster_qws.cpp:3849: 警告:提领类型双关的指针将破坏强重叠规则
kernel/qgfxraster_qws.cpp:4118: 警告:未使用的变量 ‘rgb’
make[3]: *** [kernel/qgfxraster_qws.o] 错误 1
make[3]: Leaving directory `/home/qte-2.3.2/src'
make[2]: *** [src-mt] 错误 2
make[2]: Leaving directory `/home/qte-2.3.2'
make[1]: *** [src-mt] 错误 2
make[1]: Leaving directory `/home/qte-2.3.2'
make: *** [init] 错误 2
注释了rgb。
转载于:https://www.cnblogs.com/dolphi/archive/2012/08/13/2636474.html