MSVC: error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease'
Objects or libraries were built with different C runtime settings.
Exact message you may see
LNK2038 mismatch detectedRuntimeLibrary mismatch_ITERATOR_DEBUG_LEVEL mismatch
Seen on:
MSVC Windows
Meaning
Static (/MT) and dynamic (/MD) CRTs, and Debug/Release, cannot be mixed. Same for _ITERATOR_DEBUG_LEVEL.
Common causes
- Third-party lib built with /MT
- Debug library in a Release build
- Mixed ITERATOR_DEBUG_LEVEL
⚡ Quick fix
- Rebuild everything with the same setting
- Get the matching library build
Detailed fix by platform
Visual Studio
- Project → C/C++ → Code Generation → Runtime Library
How to diagnose
- Setting — /MD vs /MT?
- Config — Debug vs Release?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- C1010 MSVC: fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h"'
- C1083 MSVC: fatal error C1083: Cannot open include file: 'foo.h': No such file or directory
- D8016 MSVC: command line error D8016: '/RTC1' and '/O2' command-line options are incompatible
Most viewed in C/C++
- AddressSanitizer: heap-use-after-free C/C++: ==ERROR: AddressSanitizer: heap-use-after-free on address — memory used after delete/free
- AddressSanitizer: heap-buffer-overflow C/C++: ==ERROR: AddressSanitizer: heap-buffer-overflow on address — READ/WRITE of size N
- Bus error C/C++: Bus error (core dumped) — SIGBUS from misaligned access or a bad memory-mapped file
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Did this fix work for you?
Report a correction or suggest an improvement
Last updated 28 Nov 2026