仅仅初始化一个SvgGen,出现无限多连接错误,请高手解答
#include <QtSvg/qsvggenerator.h>
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QSvgGenerator *svgGen = new QSvgGenerator();
svgGen->setFileName("myfile.svg" );
return app.exec();
}
cl -c -nologo -Zm200 -GS -O2 -MD -DNDEBUG -GR -EHsc -W3 -DUNICODE -DQT_L
ARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
-DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\q
t\include\QtCore" -I"..\..\qt\include\QtCore" -I"..\..\qt\include\QtGui" -I"..\.
.\qt\include\QtGui" -I"..\..\qt\include" -I"." -I"..\..\qt\include\ActiveQt" -I"
release" -I"." -I"..\..\qt\mkspecs\win32-msvc2005" -Forelease\ @C:\DOCUME~1\ADMI
NI~1\LOCALS~1\Temp\nm2DE.tmp
main.cpp
link /LIBPATH:"d:\qt\lib" /NOLOGO /SUBSYSTEM:WINDOWS /incremental:no /OU
T:"release\svg.exe" @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nm2DF.tmp
main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void
__thiscall QSvgGenerator::setFileName(class QString const &)" (__imp_?setFileNa
me@QSvgGenerator@@QAEXABVQString@@@Z),该符号在函数 _main 中被引用
main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __th
iscall QSvgGenerator::QSvgGenerator(void)" (__imp_??0QSvgGenerator@@QAE@XZ),该
符号在函数 _main 中被引用
main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual class QPaintEng
ine * __thiscall QSvgGenerator::paintEngine(void)const " (?paintEngine@QSvgGener
ator@@MBEPAVQPaintEngine@@XZ)
main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual int __thiscall
QSvgGenerator::metric(enum QPaintDevice::PaintDeviceMetric)const " (?metric@QSvg
Generator@@MBEHW4PaintDeviceMetric@QPaintDevice@@@Z)
main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virt
ual __thiscall QSvgGenerator::~QSvgGenerator(void)" (__imp_??1QSvgGenerator@@UAE
@XZ),该符号在函数 "public: virtual void * __thiscall QSvgGenerator::`scalar del
eting destructor'(unsigned int)" (??_GQSvgGenerator@@UAEPAXI@Z) 中被引用
release\svg.exe : fatal error LNK1120: 5 个无法解析的外部命令
NMAKE : fatal error U1077: “"D:\Program Files\Microsoft Visual Studio 8\VC\BIN\
link.EXE"”: 返回代码“0x460”
Stop.
NMAKE : fatal error U1077: “"D:\Program Files\Microsoft Visual Studio 8\VC\BIN\
nmake.exe"”: 返回代码“0x2”
Stop.
D:\test\svg>
[ 此贴被XChinux在2008-07-18 09:57重新编辑 ]