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
LVL 1
Albert-GeorgAsked:
Who is Participating?
 
ZoppoConnect With a Mentor Commented:
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:
Just a guess.
Do you have static linking in your project settings (the default is dynamic linking).
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
All Courses

From novice to tech pro — start learning today.