Results 1 to 6 of 6

Thread: QT Compile: Error status 1

  1. #1
    Join Date
    Mar 2011
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question QT Compile: Error status 1

    I am getting Error exit status 1 when I compile all projects.

    Here is the terminal log:

    Qt Code:
    1. g++ -m64 -Wl,-O1 -Wl,-rpath,/usr/local/stow/qt/i386_linux26/qt-4.7.2/lib -o RSS mainwindow.o moc_mainwindow.o -L/usr/local/stow/qt/i386_linux26/qt-4.7.2/lib -lQtWebKit -lQtGui -L/usr/local/stow/qt/i386_linux26/qt-4.7.2/lib -L/usr/X11R6/lib64 -lQtCore -lpthread
    2. mainwindow.o: In function `MainWindow::replyFinished(QNetworkReply*)':
    3. mainwindow.cpp:(.text+0x1fce): undefined reference to `QDomDocument::QDomDocument()'
    4. mainwindow.cpp:(.text+0x2013): undefined reference to `QDomDocument::setContent(QString const&, bool, QString*, int*, int*)'
    5. mainwindow.cpp:(.text+0x20ce): undefined reference to `QDomDocument::~QDomDocument()'
    6. mainwindow.cpp:(.text+0x20f1): undefined reference to `QDomDocument::documentElement() const'
    7. mainwindow.cpp:(.text+0x2128): undefined reference to `QDomElement::elementsByTagName(QString const&) const'
    8. mainwindow.cpp:(.text+0x21f0): undefined reference to `QDomElement::elementsByTagName(QString const&) const'
    9. mainwindow.cpp:(.text+0x2207): undefined reference to `QDomNodeList::item(int) const'
    10. mainwindow.cpp:(.text+0x221f): undefined reference to `QDomNode::firstChild() const'
    11. mainwindow.cpp:(.text+0x222f): undefined reference to `QDomNode::nodeValue() const'
    12. mainwindow.cpp:(.text+0x2237): undefined reference to `QDomNode::~QDomNode()'
    13. mainwindow.cpp:(.text+0x2244): undefined reference to `QDomNode::~QDomNode()'
    14. mainwindow.cpp:(.text+0x2251): undefined reference to `QDomNodeList::~QDomNodeList()'
    15. mainwindow.cpp:(.text+0x22a1): undefined reference to `QDomElement::elementsByTagName(QString const&) const'
    16. mainwindow.cpp:(.text+0x22b6): undefined reference to `QDomNodeList::item(int) const'
    17. mainwindow.cpp:(.text+0x22c9): undefined reference to `QDomNode::firstChild() const'
    18. mainwindow.cpp:(.text+0x22d9): undefined reference to `QDomNode::nodeValue() const'
    19. mainwindow.cpp:(.text+0x22e1): undefined reference to `QDomNode::~QDomNode()'
    20. mainwindow.cpp:(.text+0x22e9): undefined reference to `QDomNode::~QDomNode()'
    21. mainwindow.cpp:(.text+0x22f1): undefined reference to `QDomNodeList::~QDomNodeList()'
    22. mainwindow.cpp:(.text+0x2820): undefined reference to `QDomNode::~QDomNode()'
    23. mainwindow.cpp:(.text+0x282d): undefined reference to `QDomNode::~QDomNode()'
    24. mainwindow.cpp:(.text+0x283e): undefined reference to `QDomNodeList::length() const'
    25. mainwindow.cpp:(.text+0x285f): undefined reference to `QDomNodeList::item(int) const'
    26. mainwindow.cpp:(.text+0x2874): undefined reference to `QDomNode::toElement() const'
    27. mainwindow.cpp:(.text+0x28a8): undefined reference to `QDomElement::elementsByTagName(QString const&) const'
    28. mainwindow.cpp:(.text+0x28bf): undefined reference to `QDomNodeList::item(int) const'
    29. mainwindow.cpp:(.text+0x28d4): undefined reference to `QDomNode::firstChild() const'
    30. mainwindow.cpp:(.text+0x28e9): undefined reference to `QDomNode::nodeValue() const'
    31. mainwindow.cpp:(.text+0x28f6): undefined reference to `QDomNode::~QDomNode()'
    32. mainwindow.cpp:(.text+0x2903): undefined reference to `QDomNode::~QDomNode()'
    33. mainwindow.cpp:(.text+0x2910): undefined reference to `QDomNodeList::~QDomNodeList()'
    34. mainwindow.cpp:(.text+0x2a99): undefined reference to `QDomNodeList::~QDomNodeList()'
    35. mainwindow.cpp:(.text+0x2aa6): undefined reference to `QDomNode::~QDomNode()'
    36. mainwindow.cpp:(.text+0x2c59): undefined reference to `QDomDocument::~QDomDocument()'
    37. mainwindow.cpp:(.text+0x2cd5): undefined reference to `QDomNode::~QDomNode()'
    38. mainwindow.cpp:(.text+0x2ce2): undefined reference to `QDomNode::~QDomNode()'
    39. mainwindow.cpp:(.text+0x2cef): undefined reference to `QDomNodeList::~QDomNodeList()'
    40. mainwindow.cpp:(.text+0x2cfc): undefined reference to `QDomNode::~QDomNode()'
    41. mainwindow.cpp:(.text+0x2d1a): undefined reference to `QDomNodeList::~QDomNodeList()'
    42. mainwindow.cpp:(.text+0x2d2a): undefined reference to `QDomNode::~QDomNode()'
    43. mainwindow.cpp:(.text+0x2d3a): undefined reference to `QDomNode::~QDomNode()'
    44. mainwindow.cpp:(.text+0x2fab): undefined reference to `QDomNodeList::~QDomNodeList()'
    45. mainwindow.cpp:(.text+0x2fbe): undefined reference to `QDomNode::~QDomNode()'
    46. mainwindow.cpp:(.text+0x2fd1): undefined reference to `QDomNode::~QDomNode()'
    47. mainwindow.cpp:(.text+0x303f): undefined reference to `QDomNodeList::~QDomNodeList()'
    48. mainwindow.cpp:(.text+0x3052): undefined reference to `QDomNode::~QDomNode()'
    49. mainwindow.cpp:(.text+0x3060): undefined reference to `QDomNode::~QDomNode()'
    50. collect2: ld returned 1 exit status
    51. make: *** [RSS] Error 1
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2010
    Location
    Belarus
    Posts
    71
    Thanks
    1
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Windows Maemo/MeeGo

    Default Re: QT Compile: Error status 1

    maybe you need add xml to QT in your pro file ?
    Try read Qt documentation before ask stupid question.

  3. #3
    Join Date
    Aug 2009
    Location
    Greece
    Posts
    69
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT Compile: Error status 1

    Since the "undefined reference" are in QtXml module have you put QT += xml on your .pro file?
    Or did you miss an #include <QtXml> ?

  4. #4
    Join Date
    Mar 2011
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default

    I have use the qmake -project to generate the pro file. And yes, the file has QT += xml

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QT Compile: Error status 1

    The compile command you executed does not attempt to link libQtXml (just core, webkit and gui) which implies that xml was added to the PRO file after qmake was last run.
    I suggest you execute:
    Qt Code:
    1. make clean
    2. qmake
    3. make
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Mar 2011
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT Compile: Error status 1

    Fixed! The problem was with the project file.

Similar Threads

  1. error: collect2: ld returned 1 exit status
    By Splatify in forum Newbie
    Replies: 2
    Last Post: 13th February 2011, 18:09
  2. error: collect2: ld returned 1 exit status
    By srohit24 in forum Qt Programming
    Replies: 3
    Last Post: 1st December 2009, 06:32
  3. error: collect2: ld returned 1 exit status
    By nataly in forum Qt Programming
    Replies: 4
    Last Post: 13th October 2009, 13:39
  4. collect2: ld returned 1 exit status error
    By gmsk19 in forum Qt Tools
    Replies: 11
    Last Post: 25th July 2009, 02:05
  5. ld returned 1 exit status.....An unsual error
    By shamik in forum Qt Programming
    Replies: 4
    Last Post: 23rd November 2006, 10:14

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.