PDA

View Full Version : QT lnk2001 error



weixj2003ld
26th December 2009, 07:30
Hi,I add movieplayer.h and movieplayer.cpp (which are example of qt 5.4.3)to my sln,complile my sln,the following error occur,
1>movieplayer.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const MoviePlayer::staticMetaObject" (?staticMetaObject@MoviePlayer@@2UQMetaObject@@B)
1>movieplayer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall MoviePlayer::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@MoviePlayer@@UAEHW4Call@QMetaObject@ @HPAPAX@Z)
1>movieplayer.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall MoviePlayer::qt_metacast(char const *)" (?qt_metacast@MoviePlayer@@UAEPAXPBD@Z)
1>movieplayer.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall MoviePlayer::metaObject(void)const " (?metaObject@MoviePlayer@@UBEPBUQMetaObject@@XZ)
1>C:\opendtectwork\ODWork\msvc\Win32\Release\odmain. exe : fatal error LNK1120: 4

what lib should I add to my sln?
thk u.

squidge
26th December 2009, 09:55
None, add the moc-generated files, which contain those symbols.

(And if they don't exist, create them using MOC)

weixj2003ld
27th December 2009, 06:41
thk u.

I right click on movieplayer.h I add the following word to command
$(QTDIR)\bin\moc C:\opendtectwork\ODWork\include\Qt\movieplayer.h -o tmp\moc\moc_movieplayer.cpp
and compile it,the following error occur,
..\..\..\..\qt453\include\QtGui : general error c1010070: Failed to load and parse the manifest. R]?n
Please,need help.

squidge
27th December 2009, 09:44
It telling you exactly whats wrong. It can't read or parse the manifest. Either that file doesn't exist, or the path its using to get to it doesn't exist, or you don't have access. Check your output directory for the manifest (it typically ends in .manifest)

You might get better help by asking in a Visual Studio forum.