Results 1 to 7 of 7

Thread: Help with linking / debugger

  1. #1
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    2

    Post Help with linking / debugger

    I'm a total newbie with QT. I have a problem that's driving me NUTS.

    I have a program that compiles fine in 'release' mode; however, when I change to 'debug' mode, I get the message: "File not found: msvcprtd.lib (MSVCP90D.dll)". I have included the line
    LIBS += "C:/Program Files/Microsoft Visual Studio 9.0/VC/lib/msvcprtd.lib" in the .pro file (which contains the .lib file), but that isn't fixing the problem.

    Any help will be appreciated.


    Thanks

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Help with linking / debugger

    Can you share the .pro file ? Have you included conditional LIBS+= based on release and debug ?
    Check the include / lib paths for release and debuig modes

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

    simb22 (15th June 2012)

  4. #3
    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: Help with linking / debugger

    That's a debug version of a Microsoft Visual C++ runtime library. The problem is that it's required and not present. It should be found installed as a SxS assembly and in a redist directory of Visual Studio 9.0 in any correctly configured, fairly recent Microsoft dev environment.

  5. The following user says thank you to ChrisW67 for this useful post:

    simb22 (15th June 2012)

  6. #4
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    2

    Default Re: Help with linking / debugger

    Thank you for your responses. Forgive my 'newbie-ness', but I thought that by including the line LIBS += "C:/Program Files/Microsoft Visual Studio 9.0/VC/lib/msvcprtd.lib" , the linker should have found it. The file is in that directory. As you suggested, aamer4yu, here is a cut-down version of the .pro file:

    Qt Code:
    1. # ----------------------------
    2. # Project created by QtCreator
    3. # ----------------------------
    4. # defines for shared settings
    5. # if you change these be sure to adjust the libs below. Search for the constants.
    6. DEFINES += SHARED_USE_MIDITALK
    7. DEFINES += SHARED_USE_GENERALPLUSTALK
    8. DEFINES += SHARED_USE_DOWNLOADMANAGER
    9.  
    10. # Download Manager needs this (SHARED_USE_DOWNLOADMANAGER)
    11. QT += network
    12. TARGET = xxxxx
    13. TEMPLATE = app
    14. SOURCES += main.cpp \
    15. (other .cpp programs)
    16. HEADERS += ../MyDir/BaseWindow.h \
    17. (other .g files)
    18.  
    19. # now add the platform specific libs.
    20. win32 {
    21. # The below causes the manifest file to be external instead of inside the exe. This is done so we can set the Windows UAC (User Access Control)
    22. CONFIG -= embed_manifest_exe
    23.  
    24. # common stuff
    25. DEFINES += _CRT_SECURE_NO_WARNINGS
    26.  
    27.  
    28. DEFINES += __WINDOWS_MM__
    29. LIBS += Winmm.lib
    30.  
    31.  
    32. INCLUDEPATH += ../MyDir/USBPlugin
    33. DEFINES += WINDOWS_MM__
    34. DEFINES += _MBCS
    35. DEFINES -= UNICODE
    36. DEFINES -= _UNICODE
    37. LIBS += .(various .lib files)
    38. LIBS += "C:/Program Files/Microsoft Visual Studio 9.0/VC/lib/msvcprtd.lib"
    39. LIBS += /NODEFAULTLIB:msvcrt.lib
    40. QMAKE_CFLAGS_RELEASE -= -MD
    41. QMAKE_CFLAGS_RELEASE += -MT
    42. QMAKE_CXXFLAGS_RELEASE -= -MD
    43. QMAKE_CXXFLAGS_RELEASE += -MT
    44.  
    45. # Application Icon
    46. RC_FILE = ../YRG-APP-Engine/YRGicon.rc
    47. }
    48. macx { (mac stuff )
    49. }
    50.  
    51. # Finally add the resources.
    52. RESOURCES += Resources.qrc
    To copy to clipboard, switch view to plain text mode 

  7. #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: Help with linking / debugger

    Your original complaint was about debug builds, and nothing you done in this PRO specifically changes the default behaviour for a debug build... i.e. to use DLLs.

    What makes you think you need to explicitly specify the static MS VC and C++ runtime libraries? A quick test here indicates that using "/MT" alone is sufficient to remove the dependency on the DLL and use the static libraries.

    With this source file:
    Qt Code:
    1. #include <iostream>
    2.  
    3. int main(int argc, char **argv) {
    4. std::cout << "Hello world" << std::endl;
    5. return 0;
    6. }
    To copy to clipboard, switch view to plain text mode 
    and this command line in a VS command prompt:
    Qt Code:
    1. cl /MDd main.cpp
    To copy to clipboard, switch view to plain text mode 
    do you get a working executable without complaints about missing libraries? How about with "/MTd" ?

  8. #6
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    2

    Default Re: Help with linking / debugger

    Thanks, Chris. I'll test this when I get home tonight.

  9. #7
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    2

    Default Re: Help with linking / debugger

    It was indeed a compiler (actually linker) problem. Thank you for your help

Similar Threads

  1. Debugger: None of the debugger engines [...] capable of debugging binaries
    By schludy in forum Installation and Deployment
    Replies: 1
    Last Post: 21st February 2012, 19:32
  2. Replies: 3
    Last Post: 7th February 2012, 11:40
  3. cdb as debugger
    By pkj in forum Newbie
    Replies: 3
    Last Post: 27th January 2012, 14:59
  4. QT IDE and Debugger
    By onefootswill in forum Newbie
    Replies: 16
    Last Post: 25th July 2008, 21:39
  5. Need Qt IDE with Debugger
    By rajeshs in forum General Discussion
    Replies: 3
    Last Post: 10th October 2007, 13:21

Tags for this Thread

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.