Results 1 to 4 of 4

Thread: QT lnk2001 error

  1. #1
    Join Date
    Mar 2009
    Location
    Gansu,China
    Posts
    188
    Qt products
    Qt4
    Platforms
    Windows

    Default QT lnk2001 error

    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\odmai n.exe : fatal error LNK1120: 4

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

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: QT lnk2001 error

    None, add the moc-generated files, which contain those symbols.

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

  3. #3
    Join Date
    Mar 2009
    Location
    Gansu,China
    Posts
    188
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT lnk2001 error

    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.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: QT lnk2001 error

    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.

Similar Threads

  1. Gtk error when installing Qt in linux
    By john_god in forum Installation and Deployment
    Replies: 1
    Last Post: 18th November 2009, 05:08
  2. Q3ScrollView resists to scroll down to the garbage bin
    By sivrisinek in forum Qt Programming
    Replies: 0
    Last Post: 5th February 2009, 17:50
  3. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43
  4. Replies: 16
    Last Post: 23rd May 2008, 10:12
  5. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.