Question : Calling DLL function in release mode from exe in debug mode

My main application is compiled in debug mode, and make several call to a DLL.

Everything works fine until the DLL is compiled in Release mode, then the stack on some of the functions i nthat DLL become corrupt.

I have eleminated all std string from those argument to the DL function and replaced them with basic type such as char, double and integer. But I still run into the same problem.

Answer : Calling DLL function in release mode from exe in debug mode

I don't really see why havinfg the dll as 'release' and the app as 'debug' should cause this problem. After all the windows api dll's your app uses would be the release versions even for a debug app.

There is a major (and not always realised) difference between release and debug builds.  A debug build has variables set to an initial value and check bytes around variables.  A release build just uses whatever value was in that memory block (not necessarily zero) and doesn't have the safety bytes - so a buffer overrun can result in corruption of other variables that isn't seen in a debug build.

eg.
int i;
if(i != 0)
 CrashTheApp();    <<--  this shouldn't be called in debug but can occasionally be called in release.

So:  
Is the release build always failing in the same function ?
In a debug build do you see reported problems in the output window of visual studio when your app exits ?
Random Solutions  
 
programming4us programming4us