Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2649
  • Last Modified:

MTd_StaticDebug vs. MTd_DynamicDebug

Dear experts,

I am trying to compile an (MFC-based) project that uses two third party libraries (compiled as .lib). When I compile the project the linker reports the error:

error LNK2038: Conflict in "RuntimeLibrary": The value "MTd_StaticDebug" does not match the value "MDd_DynamicDebug".

Open in new window


Which settings must I change in one of the library projects in order to have both as "MTd_StaticDebug" or both as "MTd_DynamicDebug"?

Thanks in advance,

Albert
0
Albert-Georg
Asked:
Albert-Georg
  • 2
1 Solution
 
AndyAinscowFreelance programmer / ConsultantCommented:
Just a guess.
Do you have static linking in your project settings (the default is dynamic linking).
0
 
ZoppoCommented:
Hi Albert-Georg,

you should check the setting 'Code Generation->Runtime Library' in 'C/C++' project settings. They need to be equal in every involved project. IMO you should prefer to use a dynamic runtime in all projects, that is 'Multi-threaded Debug DLL (/MDd)' in a DEBUG build and 'Multi-threaded DLL (/MD)' in RELEASE builds.

In projects using MFC you should even check the setting 'Use of MFC' in 'General', it should be set to 'Use MFC in a shared DLL' when you use dynamic runtime, otherwise it should be 'Use MFC in a static library'.

Hope that helps,

ZOPPO
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
for dynamic read shared:
0000.jpg
0
 
Albert-GeorgAuthor Commented:
Dear experts,

thank you for your fast answers. I have changed both libraries to 'Multi-threaded Debug DLL (/MDd)' and now it works.

Sincerely,

Albert
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now