Bill Gates
Bill Gates

Reputation: 867

C++ link issue after switching to /MT

I am working on application which should be running on any Windows NT machine. Today I was trying to deploy my application on new machine and suddenly get error that msvcp100.dll is missing. I've started digging into that problem and found solution. Only what I had to do is in project configurations change Run time library From /MDto Multi-threaded (/MT).

But after switching to current mode I am getting link error. Not sure why and how to fix it. Could you please help me to figure that out? Thanks!

enter image description here

Upvotes: 1

Views: 69

Answers (2)

Joachim Isaksson
Joachim Isaksson

Reputation: 181037

The error comes from that when compiling in debug mode, you'll need to change your project to link with link with debug libraries, ie msvcmrtd.lib instead of msvcmrt.lib and msvcrtd.lib instead of msvcrt.lib

Deploying debug binaries to other machines may/will cause runtime problems though since the debug version sof the DLLs aren't (afaik) redistributable, what you probably want to do is to fix your release build.

Upvotes: 2

Ben Voigt
Ben Voigt

Reputation: 283793

You aren't supposed to deploy debug builds. Compile with Release settings (including release version of the run-time library) and you won't have that problem. (You can enable debug information on a release build... it's use of the debug libraries that causes problems)

Upvotes: 2

Related Questions