Results 1 to 3 of 3

Thread: Program works in Release but not Debug

  1. #1
    Join Date
    Dec 2009
    Location
    New Zealand
    Posts
    54
    Thanks
    23
    Qt products
    Qt4
    Platforms
    Windows

    Default Program works in Release but not Debug

    Hi,

    I have a program that runs fine when I select "Build>Set Build Configuration> Release" however when I select "Build>Set Build Configuration>Debug" I get the following: error: collect2: ld returned 1 exit status


    This is my project file:

    Qt Code:
    1. # -------------------------------------------------
    2. # Project created by QtCreator 2010-01-05T15:47:40
    3. # -------------------------------------------------
    4. TARGET = LoaderV5
    5. TEMPLATE = app
    6. DEPENDPATH += .
    7. INCLUDEPATH += ../..
    8. QMAKE_LIBDIR += ../../build
    9. OBJECTS_DIR = obj
    10. MOC_DIR = moc
    11. UI_DIR = uic
    12. CONFIG += qt \
    13. thread \
    14. warn_on \
    15. console # To see any output from qDebug(), you must add a line reading CONFIG += console to the project file.
    16. SOURCES += main.cpp \
    17. loader.cpp \
    18. addDialog.cpp
    19. HEADERS += loader.h \
    20. qextserialport.h \
    21. qextserialbase.h \
    22. win_qextserialport.h \
    23. addDialog.h
    24. FORMS += loader.ui
    25. CONFIG(debug, debug|release):LIBS += -lqextserialportd
    26. else:LIBS += -lqextserialport
    27. unix:DEFINES = _TTY_POSIX_
    28. win32:DEFINES = _TTY_WIN_
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Program works in Release but not Debug

    look at compile output inside Qt Creator, that will let you know why the link failed - my guess you don't have a debug version of qextserialport library.

  3. The following user says thank you to schnitzel for this useful post:

    Ferric (28th January 2010)

  4. #3
    Join Date
    Dec 2009
    Location
    New Zealand
    Posts
    54
    Thanks
    23
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: Program works in Release but not Debug

    my guess you don't have a debug version of qextserialport library.
    Yeah, you hit the nail on the head cheers once again, it is working now.

Similar Threads

  1. Replies: 3
    Last Post: 29th August 2009, 22:24
  2. Replies: 3
    Last Post: 8th June 2009, 08:07
  3. QMenu style sheet: works in dev env, breaks in release
    By JimDaniel in forum Qt Programming
    Replies: 1
    Last Post: 6th October 2008, 19:18
  4. Why not on release but debug
    By baray98 in forum Qt Programming
    Replies: 6
    Last Post: 10th August 2007, 09:08
  5. Qt 4 commercial with Visual C++ 2005 Express Edition: Works half, debug fails
    By axeljaeger in forum Installation and Deployment
    Replies: 4
    Last Post: 5th July 2006, 05:38

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.