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
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?
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.
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 ????
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.
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"
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().
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 :confused:
1 Attachment(s)
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