The subject says it - is there a reliable way to detect if a .lib static library (and a dynamic library also, if possible) was built against the debug version of MSVCRT? E.g. is there any import symbol that can be used to detect that? Basically I have an app that uses tons of dependency static libs, and at least one of them needs the debug msvcrt, because the resulting executable needs both versions of the runtime.
Asked
Active
Viewed 640 times
1 Answers
2
for dll we can use depends Dependency Walker, if the dll depends on the MSVCRxxD.DLL it is linked with debug runtime. For more information see Use Run-Time Library.
If you have cygwin you can run for example
strings xxx.lib | grep MSVCRT
or
strings xxx.dll | grep MSVCRT
and see if the D version appears

Marius
- 833
- 5
- 11
-
Thanks for the response, your answer is correct, but I found that I will need some more investigation. In fact I got the symbols that are imported by the app executable from the debug crt - one distinctive is _CrtDbgReportW. I got them with objdump -p, and found what symbols from what dlls are imported. But not who imported them - I have many libs linked, checked them one by one with objdump -t and all of them have no _CrtDbgReportW import. Any idea how I can find wht object/lib links to debug CRT? – Alexander Vassilev May 04 '12 at 15:34
-
Nailed it! THe link you posted was really helpful, more specifically the table with NODEFAULTLIB combinations when targeting a particular crt version: http://msdn.microsoft.com/en-us/library/aa267384%28VS.60%29.aspx. Thanks a lot again, you have one virtual beer from me! – Alexander Vassilev May 04 '12 at 16:11