windows下的QT编译问题:链接时提示某些虚函数 unresolved external symbol
辉歌 2004-04-28 04:05:23 从QT的中文文档例子中下载的代码,如下:
http://www.qiliang.net/qt/tutorial1-08.html
保存完文件后,用:
qmake -project -win32
生成了.pro文件,
然后qmake,生成了makefile
然后nmake
,提示:
F:\Study\t8>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
link /NOLOGO /SUBSYSTEM:windows /OUT:t8.exe @C:\DOCUME~1\Brilly\LOCALS~1
\Temp\nma02036.
cannon.obj : error LNK2001: unresolved external symbol "public: virtual bool __t
hiscall CannonField::qt_property(int,int,class QVariant *)" (?qt_property@Cannon
Field@@UAE_NHHPAVQVariant@@@Z)
cannon.obj : error LNK2001: unresolved external symbol "public: virtual bool __t
hiscall CannonField::qt_emit(int,struct QUObject *)" (?qt_emit@CannonField@@UAE_
NHPAUQUObject@@@Z)
cannon.obj : error LNK2001: unresolved external symbol "public: virtual bool __t
hiscall CannonField::qt_invoke(int,struct QUObject *)" (?qt_invoke@CannonField@@
UAE_NHPAUQUObject@@@Z)
cannon.obj : error LNK2001: unresolved external symbol "public: virtual void * _
_thiscall CannonField::qt_cast(char const *)" (?qt_cast@CannonField@@UAEPAXPBD@Z
)
cannon.obj : error LNK2001: unresolved external symbol "public: virtual char con
st * __thiscall CannonField::className(void)const " (?className@CannonField@@UBE
PBDXZ)
cannon.obj : error LNK2001: unresolved external symbol "public: static class QMe
taObject * __cdecl CannonField::staticMetaObject(void)" (?staticMetaObject@Canno
nField@@SAPAVQMetaObject@@XZ)
cannon.obj : error LNK2001: unresolved external symbol "protected: void __thisca
ll CannonField::angleChanged(int)" (?angleChanged@CannonField@@IAEXH@Z)
lcdrange.obj : error LNK2001: unresolved external symbol "public: virtual bool _
_thiscall LCDRange::qt_property(int,int,class QVariant *)" (?qt_property@LCDRang
e@@UAE_NHHPAVQVariant@@@Z)
lcdrange.obj : error LNK2001: unresolved external symbol "public: virtual bool _
_thiscall LCDRange::qt_emit(int,struct QUObject *)" (?qt_emit@LCDRange@@UAE_NHPA
UQUObject@@@Z)
lcdrange.obj : error LNK2001: unresolved external symbol "public: virtual bool _
_thiscall LCDRange::qt_invoke(int,struct QUObject *)" (?qt_invoke@LCDRange@@UAE_
NHPAUQUObject@@@Z)
lcdrange.obj : error LNK2001: unresolved external symbol "public: virtual void *
__thiscall LCDRange::qt_cast(char const *)" (?qt_cast@LCDRange@@UAEPAXPBD@Z)
lcdrange.obj : error LNK2001: unresolved external symbol "public: virtual char c
onst * __thiscall LCDRange::className(void)const " (?className@LCDRange@@UBEPBDX
Z)
lcdrange.obj : error LNK2001: unresolved external symbol "public: static class Q
MetaObject * __cdecl LCDRange::staticMetaObject(void)" (?staticMetaObject@LCDRan
ge@@SAPAVQMetaObject@@XZ)
t8.exe : fatal error LNK1120: 13 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.
环境说明:
windows server 2003
vc6
qt 3.0.1
Directory of C:\Qt\3.0.1\lib
2004-04-27 10:02 <DIR> .
2004-04-27 10:02 <DIR> ..
2004-04-27 15:53 82 editor.prl
2004-04-26 15:06 176,128 editor100.dll
2004-04-26 15:06 70,219 editor100.exp
2004-04-26 15:06 117,720 editor100.lib
2004-04-27 15:52 345 qnp.prl
2004-04-27 15:53 138 qt-mt.prl
2004-04-26 15:00 3,543,040 qt-mt301.dll
2004-04-26 14:57 2,792,404 qt-mt301.exp
2004-04-26 14:57 4,624,904 qt-mt301.lib
2004-04-26 15:00 3,543,040 qt-mt301d.dll
2004-04-26 14:57 2,792,404 qt-mt301d.exp
2004-04-26 14:57 4,624,904 qt-mt301d.lib
2004-04-26 15:00 4,104 qtmain.lib
2004-04-27 15:53 304 qtmain.prl
2004-04-26 15:02 571,962 qui.lib
2004-04-27 15:53 318 qui.prl
2004-04-26 14:31 76 README
17 File(s) 22,862,092 bytes
2 Dir(s) 5,306,253,312 bytes free