Results 1 to 2 of 2

Thread: [SIZE="6"]a simple question:error lnk2019 unresolved external symbol[/SIZE]

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

    Default [SIZE="6"]a simple question:error lnk2019 unresolved external symbol[/SIZE]

    I define a class A as follows:
    Qt Code:
    1. class A
    2. {
    3. protected:
    4. void contentsMousePressEvent (QMouseEvent *e);
    5. signals:
    6. void extractClicked();
    7. }
    8. void A::contentsMousePressEvent (QMouseEvent *e)
    9. {
    10. .....
    11. emit extractClicked();
    12. }
    To copy to clipboard, switch view to plain text mode 

    when compile,error:error LNK2019: unresolved external symbol ...
    means that can not find the function extractClicked.
    Why?

  2. #2
    Join Date
    Sep 2008
    Location
    New York
    Posts
    90
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: [SIZE="6"]a simple question:error lnk2019 unresolved external symbol[/SIZE]

    Quote Originally Posted by weixj2003ld View Post
    I define a class A as follows:
    Qt Code:
    1. class A
    2. {
    3. protected:
    4. void contentsMousePressEvent (QMouseEvent *e);
    5. signals:
    6. void extractClicked();
    7. }
    8. void A::contentsMousePressEvent (QMouseEvent *e)
    9. {
    10. .....
    11. emit extractClicked();
    12. }
    To copy to clipboard, switch view to plain text mode 


    when compile,error:error LNK2019: unresolved external symbol ...
    means that can not find the function extractClicked.
    Why?
    Try this:
    Qt Code:
    1. class A:public QWidget
    2. {
    3. Q_OBJECT
    4.  
    5. protected:
    6. void contentsMousePressEvent (QMouseEvent *e);
    7. signals:
    8. void extractClicked();
    9. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Q3ScrollView resists to scroll down to the garbage bin
    By sivrisinek in forum Qt Programming
    Replies: 0
    Last Post: 5th February 2009, 17:50
  2. shared vs static
    By alisami in forum Installation and Deployment
    Replies: 3
    Last Post: 4th October 2008, 13:04
  3. Replies: 16
    Last Post: 23rd May 2008, 10:12
  4. link error for visual studio.net 2003
    By berlin in forum Newbie
    Replies: 9
    Last Post: 29th September 2006, 16:06
  5. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 22:04

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.