Qt/QTE 编译安装问题与解决方法收藏
<script type="text/javascript"> document.body.oncopy = function() { if (window.clipboardData) { setTimeout(function() { var text = clipboardData.getData("text"); if (text && text.length>300) { text = text + "/r/n/n本文来自CSDN博客,转载请标明出处:" + location.href; clipboardData.setData("text", text); } }, 100); } } </script> <script>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>
编译Qt/Embedded
编译过程出现错误:
error 1
/root/2410clQt/qt-2.3.2/include/qvaluestack.h:57: 错误:不能将‘int remove(const char*)’的实参‘1’从‘QValueListIterator<QMap<QString, QString> >’转换到‘const char*’
/root/2410clQt/qt-2.3.2/include/qvaluestack.h: In member function ‘T QValueStack<T>::pop() [with T = QString]’:
xml/qxml.cpp:2502: instantiated from here
/root/2410clQt/qt-2.3.2/include/qvaluestack.h:57: 错误:不能将‘int remove(const char*)’的实参‘1’从‘QValueListIterator<QString>’转换到‘const char*’
make[2]: *** [xml/qxml.o] 错误 1
make[2]: Leaving directory `/root/2410clQt/qt-2.3.2/src'
make[1]: *** [sub-src] 错误 2
make[1]: Leaving directory `/root/2410clQt/qt-2.3.2'
make: *** [init] 错误 2
solving :
gedit $QTDIR/include/qvaluestack.h &
将remove( this->fromLast() );改为this->remove( this->fromLast() );
error2: ‘QWSInputMethod’ has not been declared
修正方法:
cd $QTDIR/src/kernel //$DTDIR=/home/opiehome/qt-2.3.10
gedit qwindowsystem_qws.h
在前面增加以下两行
class QWSInputMethod;
class QWSGestureMethod;
error:
kernel/qpixmapcache.cpp:125:57: 错误:asm/page.h:没有那个文件或目录
In file included from kernel/qgfx_qws.h:39,
from kernel/qpixmapcache.cpp:112:
kernel/qimage.h: In member function ‘int QImageTextKeyLang::operator<(const QImageTextKeyLang&) const’:
kernel/qimage.h:58: 警告:建议在 || 的操作数中出现的 && 前后加上括号
kernel/qpixmapcache.cpp: In constructor ‘QSharedMemoryManager::QSharedMemoryManager()’:
kernel/qpixmapcache.cpp:539: 错误:‘PAGE_SIZE’在此作用域中尚未声明
kernel/qpixmapcache.cpp:539: 错误:‘PAGE_MASK’在此作用域中尚未声明
kernel/qpixmapcache.cpp: In member function ‘void QSharedMemoryManager::internal_free(QSMemPtr)’:
kernel/qpixmapcache.cpp:773: 错误:‘PAGE_SIZE’在此作用域中尚未声明
kernel/qpixmapcache.cpp:773: 错误:‘PAGE_MASK’在此作用域中尚未声明
make[2]: *** [kernel/qpixmapcache.o] 错误 1
make[2]: Leaving directory `/root/2410clQt/qt-2.3.10/src'
make[1]: *** [sub-src] 错误 2
make[1]: Leaving directory `/root/2410clQt/qt-2.3.10'
make: *** [init] 错误 2
solving :
[root@localhost kernel]# cp /home/john/embedded-system/setup-dir/linux-2.4.21/include/asm-i386/page.h /usr/include/asm/
error3
P143
while trying the forth step:
export QTDIR=$QTEDIR
export PATH=$QTEDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTEDIR/lib:$QT2DIR/lib:$LD_LIBRARY_PATH
[root@localhost launcher]# $QTEDIR/bin/qvfb -width 640 -height 480
/root/2410clQt/qt-2.3.10/bin/qvfb: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
then:
I try:
[root@localhost lib]# pwd
/usr/lib
[root@localhost lib]# ls libstdc++.so*
libstdc++.so.6 libstdc++.so.6.0.10
there is no libstdc++.so.5:
so i try to create a link
[root@localhost lib]# ln -s libstdc++.so.6 libstdc++.so.5
but new problem exist;
[root@localhost launcher]# $QTEDIR/bin/qvfb -width 640 -height 480
/root/2410clQt/qt-2.3.10/bin/qvfb: /usr/lib/libstdc++.so.5: version `GLIBCPP_3.2' not found (required by /root/2410clQt/qt-2.3.10/bin/qvfb)
/root/2410clQt/qt-2.3.10/bin/qvfb: /usr/lib/libstdc++.so.5: version `CXXABI_1.2' not found (required by /root/2410clQt/qt-2.3.10/bin/qvfb)
so i download this low version:
rm /usr/lib/libstdc++.so.5
错误二:
qvaluestack.h:57: 错误:不能从 ‘QValueListIterator<QString>’ 转换到 ‘const char*’,为实参 ‘1’(属于 ‘int remove(const char*)’)
修正方法:
gedit $QTDIR/include/qvaluestack.h &
将remove( this->fromLast() );改为this->remove( this->fromLast() );
在Build Qt2.3.2时make出现如下问题:
成功编译的方法:
configure时要使用以下语句:
Q2:在Build Qt/Embedded时make出现以下问题:
修正方法:
nfs mount时候出现的NFS崩溃,按照以下的方式mount
mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.1.3/root/somedir /host
Q4:在测试时,“./progressbar -qws”后出现如Q3一样的提示 ,按Q3来处理。
编译Qt/Embedded
编译过程出现错误:
error 1
/root/2410clQt/qt-2.3.2/include/qvaluestack.h:57: 错误:不能将‘int remove(const char*)’的实参‘1’从‘QValueListIterator<QMap<QString, QString> >’转换到‘const char*’
/root/2410clQt/qt-2.3.2/include/qvaluestack.h: In member function ‘T QValueStack<T>::pop() [with T = QString]’:
xml/qxml.cpp:2502: instantiated from here
/root/2410clQt/qt-2.3.2/include/qvaluestack.h:57: 错误:不能将‘int remove(const char*)’的实参‘1’从‘QValueListIterator<QString>’转换到‘const char*’
make[2]: *** [xml/qxml.o] 错误 1
make[2]: Leaving directory `/root/2410clQt/qt-2.3.2/src'
make[1]: *** [sub-src] 错误 2
make[1]: Leaving directory `/root/2410clQt/qt-2.3.2'
make: *** [init] 错误 2
solving :
gedit $QTDIR/include/qvaluestack.h &
将remove( this->fromLast() );改为this->remove( this->fromLast() );
error2: ‘QWSInputMethod’ has not been declared
修正方法:
cd $QTDIR/src/kernel //$DTDIR=/home/opiehome/qt-2.3.10
gedit qwindowsystem_qws.h
在前面增加以下两行
class QWSInputMethod;
class QWSGestureMethod;
error:
kernel/qpixmapcache.cpp:125:57: 错误:asm/page.h:没有那个文件或目录
In file included from kernel/qgfx_qws.h:39,
from kernel/qpixmapcache.cpp:112:
kernel/qimage.h: In member function ‘int QImageTextKeyLang::operator<(const QImageTextKeyLang&) const’:
kernel/qimage.h:58: 警告:建议在 || 的操作数中出现的 && 前后加上括号
kernel/qpixmapcache.cpp: In constructor ‘QSharedMemoryManager::QSharedMemoryManager()’:
kernel/qpixmapcache.cpp:539: 错误:‘PAGE_SIZE’在此作用域中尚未声明
kernel/qpixmapcache.cpp:539: 错误:‘PAGE_MASK’在此作用域中尚未声明
kernel/qpixmapcache.cpp: In member function ‘void QSharedMemoryManager::internal_free(QSMemPtr)’:
kernel/qpixmapcache.cpp:773: 错误:‘PAGE_SIZE’在此作用域中尚未声明
kernel/qpixmapcache.cpp:773: 错误:‘PAGE_MASK’在此作用域中尚未声明
make[2]: *** [kernel/qpixmapcache.o] 错误 1
make[2]: Leaving directory `/root/2410clQt/qt-2.3.10/src'
make[1]: *** [sub-src] 错误 2
make[1]: Leaving directory `/root/2410clQt/qt-2.3.10'
make: *** [init] 错误 2
solving :
[root@localhost kernel]# cp /home/john/embedded-system/setup-dir/linux-2.4.21/include/asm-i386/page.h /usr/include/asm/
error3
P143
while trying the forth step:
export QTDIR=$QTEDIR
export PATH=$QTEDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTEDIR/lib:$QT2DIR/lib:$LD_LIBRARY_PATH
[root@localhost launcher]# $QTEDIR/bin/qvfb -width 640 -height 480
/root/2410clQt/qt-2.3.10/bin/qvfb: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
then:
I try:
[root@localhost lib]# pwd
/usr/lib
[root@localhost lib]# ls libstdc++.so*
libstdc++.so.6 libstdc++.so.6.0.10
there is no libstdc++.so.5:
so i try to create a link
[root@localhost lib]# ln -s libstdc++.so.6 libstdc++.so.5
but new problem exist;
[root@localhost launcher]# $QTEDIR/bin/qvfb -width 640 -height 480
/root/2410clQt/qt-2.3.10/bin/qvfb: /usr/lib/libstdc++.so.5: version `GLIBCPP_3.2' not found (required by /root/2410clQt/qt-2.3.10/bin/qvfb)
/root/2410clQt/qt-2.3.10/bin/qvfb: /usr/lib/libstdc++.so.5: version `CXXABI_1.2' not found (required by /root/2410clQt/qt-2.3.10/bin/qvfb)
so i download this low version:
rm /usr/lib/libstdc++.so.5
再安装
rpm -ivh compat-libstdc++-33-3.2.3-47.3.i386.rpm
result:
[root@localhost lib]# ls libstdc++.so*
libstdc++.so.5.0.7 libstdc++.so.6 libstdc++.so.6.0.10
[root@localhost lib]# ln -s libstdc++.so.5.0.7 libstdc++.so.5
[root@localhost lib]#
now
[root@localhost launcher]# $QTEDIR/bin/qvfb -width 640 -height 480
OK, virtual frambuffer start successfully
then , i open a new shell window.
and try to start a example program
[root@localhost john]# cd ~/2410clQt
[root@localhost 2410clQt]# export QTEDIR=$PWD/qt-2.3.10
[root@localhost 2410clQt]# cd $QTEDIR/examples/launcher
[root@localhost launcher]# ./launcher -qws
Cannot find font definition file /lib/fonts/fontdir - is $QTDIR set correctly?
[root@localhost launcher]#
now try to solving this new problem by
[root@localhost launcher]# export QTDIR=$QTEDIR
[root@localhost launcher]# export PATH=$QTEDIR/bin:$PATH
[root@localhost launcher]# export LD_LIBRARY_PATH=$QTEDIR/lib:$QT2DIR/lib:$LD_LIBRARY_PATH
[root@localhost launcher]# ./launcher -qws
libpng error: Valid palette required for paletted images
[root@localhost launcher]#
it works correctly ,
but still have an error.
maybe, following link is associated with this problem , but now ,i am too tired to continue my work today.
http://lists.trolltech.com/qt4-preview-feedback/2005-01/thread00058-0.html
result:
[root@localhost lib]# ls libstdc++.so*
libstdc++.so.5.0.7 libstdc++.so.6 libstdc++.so.6.0.10
[root@localhost lib]# ln -s libstdc++.so.5.0.7 libstdc++.so.5
[root@localhost lib]#
now
[root@localhost launcher]# $QTEDIR/bin/qvfb -width 640 -height 480
OK, virtual frambuffer start successfully
then , i open a new shell window.
and try to start a example program
[root@localhost john]# cd ~/2410clQt
[root@localhost 2410clQt]# export QTEDIR=$PWD/qt-2.3.10
[root@localhost 2410clQt]# cd $QTEDIR/examples/launcher
[root@localhost launcher]# ./launcher -qws
Cannot find font definition file /lib/fonts/fontdir - is $QTDIR set correctly?
[root@localhost launcher]#
now try to solving this new problem by
[root@localhost launcher]# export QTDIR=$QTEDIR
[root@localhost launcher]# export PATH=$QTEDIR/bin:$PATH
[root@localhost launcher]# export LD_LIBRARY_PATH=$QTEDIR/lib:$QT2DIR/lib:$LD_LIBRARY_PATH
[root@localhost launcher]# ./launcher -qws
libpng error: Valid palette required for paletted images
[root@localhost launcher]#
it works correctly ,
but still have an error.
maybe, following link is associated with this problem , but now ,i am too tired to continue my work today.
http://lists.trolltech.com/qt4-preview-feedback/2005-01/thread00058-0.html
错误二:
qvaluestack.h:57: 错误:不能从 ‘QValueListIterator<QString>’ 转换到 ‘const char*’,为实参 ‘1’(属于 ‘int remove(const char*)’)
修正方法:
gedit $QTDIR/include/qvaluestack.h &
将remove( this->fromLast() );改为this->remove( this->fromLast() );
在Build Qt2.3.2时make出现如下问题:
xml/qxml.h:214: 警告:‘class QXmlReader’ 有虚函数却没有虚析构函数
xml/qxml.h:402: 警告:‘class QXmlContentHandler’ 有虚函数却没有虚析构函数
xml/qxml.h:419: 警告:‘class QXmlErrorHandler’ 有虚函数却没有虚析构函数
xml/qxml.h:428: 警告:‘class QXmlDTDHandler’ 有虚函数却没有虚析构函数
xml/qxml.h:436: 警告:‘class QXmlEntityResolver’ 有虚函数却没有虚析构函数
xml/qxml.h:443: 警告:‘class QXmlLexicalHandler’ 有虚函数却没有虚析构函数
xml/qxml.h:456: 警告:‘class QXmlDeclHandler’ 有虚函数却没有虚析构函数
xml/qxml.cpp:1518: 警告:未使用的参数 ‘ret’
/qt/qtx11/include/qvaluestack.h: In member function ‘T QValueStack<T>::pop() [with T = QMap<QString, QString>]’:
xml/qxml.cpp:513: instantiated from here
/qt/qtx11/include/qvaluestack.h:57: 错误:不能从 ‘QValueListIterator<QMap<QString, QString> >’ 转换到 ‘const char*’,为实参 ‘1’(属于 ‘int remove(const char*)’)
/qt/qtx11/include/qvaluestack.h: In member function ‘T QValueStack<T>::pop() [with T = QString]’:
xml/qxml.cpp:2502: instantiated from here
/qt/qtx11/include/qvaluestack.h:57: 错误:不能从 ‘QValueListIterator<QString>’ 转换到 ‘const char*’,为实参 ‘1’(属于 ‘int remove(const char*)’)
make[2]: *** [xml/qxml.o] 错误 1
make[2]: Leaving directory `/qt/qtx11/src'
make[1]: *** [sub-src] 错误 2
make[1]: Leaving directory `/qt/qtx11'
make: *** [init] 错误 2
xml/qxml.h:402: 警告:‘class QXmlContentHandler’ 有虚函数却没有虚析构函数
xml/qxml.h:419: 警告:‘class QXmlErrorHandler’ 有虚函数却没有虚析构函数
xml/qxml.h:428: 警告:‘class QXmlDTDHandler’ 有虚函数却没有虚析构函数
xml/qxml.h:436: 警告:‘class QXmlEntityResolver’ 有虚函数却没有虚析构函数
xml/qxml.h:443: 警告:‘class QXmlLexicalHandler’ 有虚函数却没有虚析构函数
xml/qxml.h:456: 警告:‘class QXmlDeclHandler’ 有虚函数却没有虚析构函数
xml/qxml.cpp:1518: 警告:未使用的参数 ‘ret’
/qt/qtx11/include/qvaluestack.h: In member function ‘T QValueStack<T>::pop() [with T = QMap<QString, QString>]’:
xml/qxml.cpp:513: instantiated from here
/qt/qtx11/include/qvaluestack.h:57: 错误:不能从 ‘QValueListIterator<QMap<QString, QString> >’ 转换到 ‘const char*’,为实参 ‘1’(属于 ‘int remove(const char*)’)
/qt/qtx11/include/qvaluestack.h: In member function ‘T QValueStack<T>::pop() [with T = QString]’:
xml/qxml.cpp:2502: instantiated from here
/qt/qtx11/include/qvaluestack.h:57: 错误:不能从 ‘QValueListIterator<QString>’ 转换到 ‘const char*’,为实参 ‘1’(属于 ‘int remove(const char*)’)
make[2]: *** [xml/qxml.o] 错误 1
make[2]: Leaving directory `/qt/qtx11/src'
make[1]: *** [sub-src] 错误 2
make[1]: Leaving directory `/qt/qtx11'
make: *** [init] 错误 2
成功编译的方法:
更改qt-2.3.2文件夹中src/tools/qvaluestack.h第57行源代码:
remove (this->formLast() );
为:
this->remove (this->formLast() );
configure时要使用以下语句:
./configure -debug -no-opengl -no-xft
Q2:在Build Qt/Embedded时make出现以下问题:
error: ‘QWSInputMethod’ has not been declared
修正方法:
cd $QTDIR/src/kernel //$DTDIR=/home/opiehome/qt-2.3.10
gedit qwindowsystem_qws.h
gedit qwindowsystem_qws.h
在前面增加以下两行:
class QWSInputMethod;
class QWSGestureMethod;
Q3:使用nfs时在cp一些大点的文件时,出现NFS的错误:
class QWSGestureMethod;
nfs: server *** not responding, still trying
修改方法:
nfs mount时候出现的NFS崩溃,按照以下的方式mount
mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.1.3/root/somedir /host
Q4:在测试时,“./progressbar -qws”后出现如Q3一样的提示 ,按Q3来处理。