Results 1 to 6 of 6

Thread: Unresolved external symbol "staticMetaObject"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Posts
    2

    Default Re: Unresolved external symbol "staticMetaObject"

    Totem, I just used -no-webkit to speed up the build -- do you mean webkit should be build for dependency? Thanks.

  2. #2
    Join Date
    Feb 2010
    Posts
    99
    Thanks
    31
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Unresolved external symbol "staticMetaObject"

    sr71, I am also getting same linker error. My setup is VS2005 + Qt 4.6.2 (precompiled libs that Qt provides)

    I don't think -no-webkit is an issue.

    I found that if I remove Q_OBJECT from .h file the application compiles ok. Also I exported the project to .pro and compiling it in Qt Creator also works fine (this is with Q_OBJECT) in .h file. I don't think that removing Q_OBJECT is a solution to this issue. Anybody???

  3. #3
    Join Date
    Sep 2009
    Location
    Surrey, BC, Canada
    Posts
    110
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Unresolved external symbol "staticMetaObject"

    My post is here
    http://www.qtcentre.org/threads/3202...tPlot-staticMe

    Probably, I've got exactly the same problem as yours.
    Did you solve this problem already? If so, please do give me a hand.

    Thank you very much in advance.

    Best Regards
    JIA
    Welcome to Vision Open
    http://www.visionopen.com

  4. #4
    Join Date
    Sep 2009
    Location
    Surrey, BC, Canada
    Posts
    110
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Unresolved external symbol "staticMetaObject"

    Yes, after removing
    Q_OBJECT
    from my .h file, I can get my application compiled and built.
    However, when I ran it, I confronted another issue "Seg fault on program start", as posted here:
    http://www.osgeo.org/pipermail/qgis-...ch/006230.html


    Well, may I ask:

    1)
    What is the purpose of
    Qt Code:
    1. Q_OBJECT
    To copy to clipboard, switch view to plain text mode 
    after my class definition? For example, my class looks like:
    Qt Code:
    1. class CDataPlot : public QwtPlot
    2. {
    3. Q_OBJECT
    4. private:
    5. ....
    6. };
    To copy to clipboard, switch view to plain text mode 
    What is
    Q_OBJECT
    used for?


    2)
    Without Q_OBJECT, I obtained this warning and the program won't start.
    Warning: QObject::connect: Connecting from COMPAT signal (QAction::activated())
    With Q_OBJECT, I obtained the following error compilation message:
    error LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMetaObject" (?staticMetaObject@QwtPlot@@2UQMetaObject@@B)
    3) My Environments:
    WindowsXP+Visual Studio 2008+qt-vs-addin-1.1.5.exe+qwt-5.2.1

    4)
    In addition, under Ubuntu 10.04, the same program runs perfectly.

    So, can anybody help please?

    Best Regards
    JIA
    Welcome to Vision Open
    http://www.visionopen.com

Similar Threads

  1. unresolved external symbol with qwt3d
    By pospiech in forum Qt Programming
    Replies: 6
    Last Post: 2nd February 2016, 21:47
  2. unresolved external symbol
    By gridolfi in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2009, 17:58
  3. Replies: 1
    Last Post: 10th April 2009, 18:07
  4. unresolved external symbol
    By tgreaves in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2009, 19:49
  5. Unresolved External Symbol
    By munna in forum General Discussion
    Replies: 1
    Last Post: 10th May 2006, 19:25

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.