Results 1 to 9 of 9

Thread: How to run a debug app linked against a release binary

  1. #1
    Join Date
    Aug 2010
    Posts
    36
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default How to run a debug app linked against a release binary

    Hi ,

    I have created a library in release mode and I want to be able to use it in an app that is built in debug mode. Every time I run the app it crashes.

    Is it possible to achieve that??
    If Yes, Could you please suggest me how could I implement that ???

    Any help would be highly appreciated.

    Regards,
    Raj

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to run a debug app linked against a release binary

    u can use the library with your debug app. What is the crash?

  3. #3
    Join Date
    Aug 2010
    Posts
    36
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to run a debug app linked against a release binary

    I dont see any specific error message.
    If I run it from Qt Creator ... it just crashes with error: exited with code 1.
    If I double click the app ... it just doesnt do anything ... I can see in the Task Manager that it tries to start but then just goes away without any message ... Actual app never shows up here in this case.

  4. #4
    Join Date
    Aug 2010
    Posts
    36
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to run a debug app linked against a release binary

    Is there anything specific that I need to do at Library's code or configuration ????

  5. #5
    Join Date
    Feb 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to run a debug app linked against a release binary

    Raj, these silent crashes usually happen when some dynamic library is missing or cannot be found by the app. If you're working with Windows, check your app with Dependency Walker. You can also open the Event Viewer to check for errors. Usually "side by side" errors will create one or more error registers there.

  6. #6
    Join Date
    Aug 2010
    Posts
    36
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to run a debug app linked against a release binary

    Hmmm ... lemme check that ...


    Added after 11 minutes:


    Hmmm ... I tried to run dependency walker on both versions(debug and release ) of my exe ... and surprisingly for the debug version it is giving me an error related to MSVCR90.DLL ... "Error Opening File. The system cannot find the file Specified"
    Last edited by rajji_saini; 28th February 2011 at 22:49.

  7. #7
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to run a debug app linked against a release binary

    did you tried to debug your application? At least put some print/qdebug statements at various places in main().

  8. #8
    Join Date
    Aug 2010
    Posts
    36
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Post Re: How to run a debug app linked against a release binary

    I did that but no success ... App crashes out the moment it tries to create the object from my library

  9. #9
    Join Date
    Aug 2010
    Posts
    36
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to run a debug app linked against a release binary

    Ok here is what I have :

    In my dll I am doing this:


    #include "testlib.h"


    TestLib::TestLib()
    {

    }

    TestLib::~TestLib()
    {

    }

    const QString TestLib::multiply(float a, float b) const
    {
    return QString("%1").arg(a * b);
    }

    const float TestLib::multiplyF(float a, float b) const
    {
    return (a * b);
    }


    In my App I am doing this:


    #include <QtCore/QCoreApplication>
    #include "testlib.h"


    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);

    TestLib* p = new TestLib();
    qDebug() << p->multiplyF(5,8);


    return a.exec();
    }


    So now if I invoke a call that returns float as result then the combination of Debug app against release dll works fine. However If I make call to method that returns QString then I get following crash error:

    Debug Assertion Failed:
    Expression: _CrtIsValidHeapPointer(pUserData)
    Please see the attachment
    Attached Images Attached Images

Similar Threads

  1. Qt Creator How to set .pro file about debug and release
    By yycking in forum Qt Tools
    Replies: 2
    Last Post: 28th February 2011, 18:28
  2. Debug or Release mode in MAC
    By ssaa in forum Installation and Deployment
    Replies: 6
    Last Post: 9th March 2010, 05:15
  3. Replies: 0
    Last Post: 22nd May 2009, 09:55
  4. Why not on release but debug
    By baray98 in forum Qt Programming
    Replies: 6
    Last Post: 10th August 2007, 09:08
  5. Debug and Release
    By paranoid_android in forum Qt Programming
    Replies: 5
    Last Post: 18th November 2006, 13:58

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.