views:

124

answers:

2

I have regularly this issue under Visual 2005 or 2008 :

When I compile a bunch of DLLs (native C, C++, managed), sometimes, few of them don't link correctly with some microsoft debug DLLs. The output does not mention anything (no warning, no error). I can't be aware until I launch my program and get a "Module not found exception" without more explanations.

When I open my Dlls with Dependency Walker, some are missing MSVCR90D.DLL and MSVCP90D.DLL. If i am in a lucky moment, i just have to rebuild the corrupted dll to get a valid one. In the worst case, the rebuild produces another corrupted dll, until a mysterious moment (hours or days later) when a got a valid dll... sounds crazy, isnt it ?

The valid dll have this kind of path :

*c:\windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCP90D.DLL*

This is driving me insane!... Any ideas ? Thanks.

+1  A: 

Build with /MT instead of /MD.

jeffamaphone
Could you explain why that would fix the issue?
Steve Rowe
See here: http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx
Naaff
indeed, it solves the issue! Thanks. But i dont like to get stuck on something i don't understand... /MDd works fine most of the time. Why sometime it doesn't ?@Steve Rowe : it fixes the issue because you don't link with debug dll anymore. It uses static lib.
rockeye
I'm not certain what the exact issue you had was, but whenever MSVCR90.dll rears its ugly head, you can always switch to the statically linked CRT instead. This is more of a work around than a valid solution to your problem.
jeffamaphone
+1  A: 

Maybe it is getting confused of which dll to use. Do a search under C:\Program files\Visual Studio??? for MSVCR90D.DLL and it should be under like C:\Program files\Visual Studio???\sdk...\bin I am not sure what version you have. Then in your environment PATH, set that path up in there to look in that bin path.

I have seen plenty of times where there are many dlls of the same name and the program gets confused of which one it should be linking with. Try that and see if that helps

Janet

Janet Rans