Results 1 to 2 of 2

Thread: Link error in Windows

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Link error in Windows

    Hi,

    I have a class in library as:
    Qt Code:
    1. class MY_EXPORT MyWidget : public QWidget
    2. {
    3. Q_OBJECT
    4. ...
    5. };
    To copy to clipboard, switch view to plain text mode 

    Where in Windows, MY_EXPORT is defined as "__declspec(dllexport)"

    Now I use this class to build executable by linking to its library
    Qt Code:
    1. class DerivedWidget : public MyWidget {
    2. Q_OBJECT
    3. ...
    4. };.
    To copy to clipboard, switch view to plain text mode 

    On linking, it complains errors:

    moc_DerivedWidget.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const MyWidget::staticMetaObject" (?staticMetaObject@MyWidget@@2UQMetaObject@@B)

    Please help. Many thanks!

  2. #2
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Link error in Windows

    Found the problem. it is related to import/export...something that is totally screwed by Microsoft...

Similar Threads

  1. Qt Jambi, deploying app on Mac & Windows fails
    By ChrisColon in forum Installation and Deployment
    Replies: 2
    Last Post: 16th February 2009, 23:05
  2. Replies: 5
    Last Post: 15th January 2009, 10:03
  3. Link errors for plugin under windows
    By QPlace in forum Qt Programming
    Replies: 5
    Last Post: 2nd November 2008, 16:51
  4. Link errors when linking chained libraries on windows
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2008, 15:52
  5. Qt and windows vista
    By munna in forum General Discussion
    Replies: 8
    Last Post: 11th January 2006, 23:33

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.