views:

42

answers:

2

Hello,

I have been unable to find much or any information on this. I have a project which is built using VS2005, thus using the mscvr80.dll. My project also loads a third party library, which then loads up mscvrt60.dll.

Now I have a strange bug in my program where the program crashes with a memory read violation (in debug it is at 0xcdcdcdcd, which from my searches describes an non-initialized memory location). The debugger indicates that the violation is within an unknown function in the third party library.

I have contacted the owners of this library and they do not know of any error, as described. Also, I have other projects, compiled in VS60, which use this third party library, and that do not have similar errors. Thus I am wondering, can there be issues with using multiple common runtime versions? I remember vaguely hearing about situations where one runtime (say in the .dll) could allocate memory, and then if the other version tries to free this memory, that can cause issues. However, I cannot remember where I read this, nor can I find much information on the subject.

Any input is much appreciated.

+1  A: 

Freeing memory allocated by one version of the runtime in another version can certainly cause problems. There's no guarantee that the implementation details of the CRT heap remained the same between versions. If you can't find any other work arounds, you can try compiling your application against mscvrt60.dll.

Peter Ruderman
Is there a simple way to compile my project against v60? Without actually trying to downgrade the solution to Visual C++ 6.0?
DeusAduro
Well, if you have VC6 installed, you can choose the "no default librairies" option in your linker settings. Then manually point it to the older librairies.
Peter Ruderman
+1  A: 

If you are seeing 0xcdcdcdcd, then you may be mixing the debug run-time library and the release run-time library. They should work OK together, but you might try replicating the issue using only the release runtime.

Kristopher Johnson
Thanks, but I've checked the loaded libraries and it is definitely both debug (when in debug) and both release (when in release.
DeusAduro