How can I link my project to the debug version of the MFC DLL in Release mode?

1k views Asked by At

I am working on a project which is in release build. I can't work on debug build for certain reason.

In the Release build, can I instruct Visual Studio to link against debug version of MFC DLLs, so I can step into MFC source code? If yes, how could I do it?

1

There are 1 answers

1
Hans Passant On

You are voiding the warranty doing this. It seemed to work okay though when I tried it on a sample MFC app. Project + Properties, Linker, Command line is where to get started. First put /VERBOSE in there and rebuild the project to see what .libs get linked right now. You need to use /NODEFAULTLIB to disable the release versions of the .libs and add the debug versions of the .libs. You also need to switch the CRT version, /MTd or /MDd depending on which one you use, Project + Properties, C/C++, Code generation, Runtime library.

Using VS2008 I ended up with these linker settings:

/VERBOSE /NODEFAULTLIB:mfc90u.lib /NODEFAULTLIB:mfcs90u.lib mfc90ud.lib mfcs90ud.lib