Results 1 to 4 of 4

Thread: moc link error

  1. #1
    Join Date
    Jan 2007
    Posts
    92
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default moc link error

    I am getting some linking errors with QMetaObject while trying to compile the application.


    In the header .h files, the macro Q_OBJECT has been included. All moc-file are created in my generated files. I have been building with Vs 2003 and Qt 4.3.

    But i still have no idea to get rid of following errors:-


    mapDlg.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const mapDlg::staticMetaObject" (?staticMetaObject@mapDlg@@2UQMetaObject@@B)
    mapDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall mapDlg::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@mapDlg@@UAEHW4Call@QMetaObject@@HPAP AX@Z)
    mapDlg.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall mapDlg::metaObject(void)const " (?metaObject@mapDlg@@UBEPBUQMetaObject@@XZ)
    ..\..\..\..\exe\mapDlg.dll : fatal error LNK1120:3 unresolved externals
    Any idea will be helpful.
    Last edited by jacek; 28th June 2007 at 19:19. Reason: changed [code] to [quote]

  2. #2
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: moc link error

    Please provide more information eg .cpp and .h files

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: moc link error

    Are you sure that the library is linked against the code from the .moc file?

  4. The following user says thank you to jacek for this useful post:

    user_mail07 (3rd July 2007)

  5. #4
    Join Date
    Jan 2007
    Posts
    92
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default Re: moc link error

    Sorry for posting late.

    The problem was fixed. After adding config += staticlib to the project file.

    Thanks for ideas.

Similar Threads

  1. Installation on Fedora Core 4
    By jcr in forum Installation and Deployment
    Replies: 3
    Last Post: 29th January 2009, 01:34
  2. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19
  3. Qt-x11-commercial-src-4.2.0-snapshot-20060824 error
    By DevObject in forum Installation and Deployment
    Replies: 4
    Last Post: 24th August 2006, 23:31
  4. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52
  5. Am I the only one with "make" error ?
    By probine in forum Installation and Deployment
    Replies: 1
    Last Post: 13th February 2006, 12:54

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.