I'm building a DLL in Visual C++ 2008, and I want to have the runtime statically linked into the DLL. So I went into the project options and set Runtime Library to Multi-threaded (/MT)
. This has always worked for other projects in the past. But when I build this one, I still end up with Dependency Walker showing MSVCR90.dll in the list.
Anyone know what could cause that?
Project + Properties, Linker, Command Line. Add the /verbose option. Build + Rebuild. The Output window shows you the linker searching for symbols. Watch out for msvcrt.lib, that's the one that pulls in the dependency on msvcr90.dll
The typical cause is linking a .lib that has one or more .obj files that were compiled with /MD. A dependency on msvcrt.lib gets injected with the #pragma comment(lib, msvcrt.lib) directive. That tells the linker to search msvcrt.lib without you explicitly specifying it as a dependency in Linker, Input, Additional Dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With