当前位置: 技术问答>linux和unix
QT程序编译时的错误
来源: 互联网 发布时间:2016-07-06
本文导语: 是编译最简单的HELLO程序 已生成hello.pro和makefile D:qthello>make make后出现以下错误信息:(望高手指点) mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory `D:/qt/hello' g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -...
是编译最简单的HELLO程序
已生成hello.pro和makefile
D:qthello>make
make后出现以下错误信息:(望高手指点)
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `D:/qt/hello'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:Qt
4.3.2includeQtCore" -I"c:Qt4.3.2includeQtCore" -I"c:Qt4.3.2includeQtG
ui" -I"c:Qt4.3.2includeQtGui" -I"c:Qt4.3.2include" -I"." -I"c:Qt4.3.2i
ncludeActiveQt" -I"debug" -I"." -I"c:Qt4.3.2mkspecswin32-g++" -o debughell
o.o hello.cpp
In file included from c:Qt4.3.2include/QtGui/qcolor.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/kernel/qpalette.h:
43,
from c:Qt4.3.2include/QtGui/qpalette.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/kernel/qwidget.h:4
5,
from c:Qt4.3.2include/QtGui/qwidget.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/widgets/qframe.h:4
2,
from c:Qt4.3.2include/QtGui/qframe.h:1,
from c:Qt4.3.2includeQtGui/../../src/gui/widgets/qlabel.h:4
2,
from c:Qt4.3.2includeQtGui/qlabel.h:1,
from c:Qt4.3.2includeQtGui/QLabel:1,
from hello.cpp:2:
c:Qt4.3.2include/QtGui/../../src/gui/painting/qcolor.h:236: warning: 'QDataSt
ream& operator>(QDataStream&, QColor&)' redeclared without dllimport attribute:
previous dllimport ignored
In file included from c:Qt4.3.2include/QtGui/qpainterpath.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/painting/qtransfor
m.h:42,
from c:Qt4.3.2include/QtGui/qtransform.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/painting/qbrush.h:
47,
from c:Qt4.3.2include/QtGui/qbrush.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/kernel/qpalette.h:
44,
from c:Qt4.3.2include/QtGui/qpalette.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/kernel/qwidget.h:4
5,
from c:Qt4.3.2include/QtGui/qwidget.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/widgets/qframe.h:4
2,
from c:Qt4.3.2include/QtGui/qframe.h:1,
from c:Qt4.3.2includeQtGui/../../src/gui/widgets/qlabel.h:4
2,
from c:Qt4.3.2includeQtGui/qlabel.h:1,
from c:Qt4.3.2includeQtGui/QLabel:1,
from hello.cpp:2:
c:Qt4.3.2include/QtGui/../../src/gui/painting/qpainterpath.h:206: warning: 'Q
DataStream& operator>(QDataStream&, QPainterPath&)' redeclared without dllimpor
t attribute: previous dllimport ignored
In file included from c:Qt4.3.2include/QtGui/qkeysequence.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/kernel/qwidget.h:5
3,
from c:Qt4.3.2include/QtGui/qwidget.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/widgets/qframe.h:4
2,
from c:Qt4.3.2include/QtGui/qframe.h:1,
from c:Qt4.3.2includeQtGui/../../src/gui/widgets/qlabel.h:4
2,
from c:Qt4.3.2includeQtGui/qlabel.h:1,
from c:Qt4.3.2includeQtGui/QLabel:1,
from hello.cpp:2:
c:Qt4.3.2include/QtGui/../../src/gui/kernel/qkeysequence.h:191: warning: 'QDa
taStream& operator>(QDataStream&, QKeySequence&)' redeclared without dllimport
attribute: previous dllimport ignored
C:DOCUME~1ADMINI~1LOCALS~1Temp/ccYvZXS3.s: Assembler messages:
C:DOCUME~1ADMINI~1LOCALS~1Temp/ccYvZXS3.s:516: Error: unknown pseudo-op: `.s
ecrel32'
……(省去N行)
C:DOCUME~1ADMINI~1LOCALS~1Temp/ccYvZXS3.s:69187: Error: unknown pseudo-op: `.s
ecrel32'
mingw32-make[1]: *** [debughello.o] Error 1
mingw32-make[1]: Leaving directory `D:/qt/hello'
mingw32-make: *** [debug] Error 2
D:qthello>
已生成hello.pro和makefile
D:qthello>make
make后出现以下错误信息:(望高手指点)
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `D:/qt/hello'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:Qt
4.3.2includeQtCore" -I"c:Qt4.3.2includeQtCore" -I"c:Qt4.3.2includeQtG
ui" -I"c:Qt4.3.2includeQtGui" -I"c:Qt4.3.2include" -I"." -I"c:Qt4.3.2i
ncludeActiveQt" -I"debug" -I"." -I"c:Qt4.3.2mkspecswin32-g++" -o debughell
o.o hello.cpp
In file included from c:Qt4.3.2include/QtGui/qcolor.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/kernel/qpalette.h:
43,
from c:Qt4.3.2include/QtGui/qpalette.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/kernel/qwidget.h:4
5,
from c:Qt4.3.2include/QtGui/qwidget.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/widgets/qframe.h:4
2,
from c:Qt4.3.2include/QtGui/qframe.h:1,
from c:Qt4.3.2includeQtGui/../../src/gui/widgets/qlabel.h:4
2,
from c:Qt4.3.2includeQtGui/qlabel.h:1,
from c:Qt4.3.2includeQtGui/QLabel:1,
from hello.cpp:2:
c:Qt4.3.2include/QtGui/../../src/gui/painting/qcolor.h:236: warning: 'QDataSt
ream& operator>(QDataStream&, QColor&)' redeclared without dllimport attribute:
previous dllimport ignored
In file included from c:Qt4.3.2include/QtGui/qpainterpath.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/painting/qtransfor
m.h:42,
from c:Qt4.3.2include/QtGui/qtransform.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/painting/qbrush.h:
47,
from c:Qt4.3.2include/QtGui/qbrush.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/kernel/qpalette.h:
44,
from c:Qt4.3.2include/QtGui/qpalette.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/kernel/qwidget.h:4
5,
from c:Qt4.3.2include/QtGui/qwidget.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/widgets/qframe.h:4
2,
from c:Qt4.3.2include/QtGui/qframe.h:1,
from c:Qt4.3.2includeQtGui/../../src/gui/widgets/qlabel.h:4
2,
from c:Qt4.3.2includeQtGui/qlabel.h:1,
from c:Qt4.3.2includeQtGui/QLabel:1,
from hello.cpp:2:
c:Qt4.3.2include/QtGui/../../src/gui/painting/qpainterpath.h:206: warning: 'Q
DataStream& operator>(QDataStream&, QPainterPath&)' redeclared without dllimpor
t attribute: previous dllimport ignored
In file included from c:Qt4.3.2include/QtGui/qkeysequence.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/kernel/qwidget.h:5
3,
from c:Qt4.3.2include/QtGui/qwidget.h:1,
from c:Qt4.3.2include/QtGui/../../src/gui/widgets/qframe.h:4
2,
from c:Qt4.3.2include/QtGui/qframe.h:1,
from c:Qt4.3.2includeQtGui/../../src/gui/widgets/qlabel.h:4
2,
from c:Qt4.3.2includeQtGui/qlabel.h:1,
from c:Qt4.3.2includeQtGui/QLabel:1,
from hello.cpp:2:
c:Qt4.3.2include/QtGui/../../src/gui/kernel/qkeysequence.h:191: warning: 'QDa
taStream& operator>(QDataStream&, QKeySequence&)' redeclared without dllimport
attribute: previous dllimport ignored
C:DOCUME~1ADMINI~1LOCALS~1Temp/ccYvZXS3.s: Assembler messages:
C:DOCUME~1ADMINI~1LOCALS~1Temp/ccYvZXS3.s:516: Error: unknown pseudo-op: `.s
ecrel32'
……(省去N行)
C:DOCUME~1ADMINI~1LOCALS~1Temp/ccYvZXS3.s:69187: Error: unknown pseudo-op: `.s
ecrel32'
mingw32-make[1]: *** [debughello.o] Error 1
mingw32-make[1]: Leaving directory `D:/qt/hello'
mingw32-make: *** [debug] Error 2
D:qthello>
|
楼主的Qt环境没配置好吧,
不用这么麻烦的,
可以去下一个Qt SDK,
在Win下开发Qt程序。
包含IDE:Qt-Creator
http://get.qtsoftware.com/qtsdk/qt-sdk-win-opensource-2009.03.1.exe
也可以选择别的版本:
http://www.qtsoftware.com/downloads
不用这么麻烦的,
可以去下一个Qt SDK,
在Win下开发Qt程序。
包含IDE:Qt-Creator
http://get.qtsoftware.com/qtsdk/qt-sdk-win-opensource-2009.03.1.exe
也可以选择别的版本:
http://www.qtsoftware.com/downloads
|
qmake -project
qmake
都没出现问题??
qmake
都没出现问题??
|
QT安装有问题,
或者就是头文件包含有错。
或者就是头文件包含有错。