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

  1. Rebuild everything with the same setting
  2. Get the matching library build

Detailed fix by platform

Visual Studio

  1. Project → C/C++ → Code Generation → Runtime Library

How to diagnose

  1. Setting — /MD vs /MT?
  2. 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:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

C1010 — MSVC: fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h"' (C/C++)C1010C1083 — MSVC: fatal error C1083: Cannot open include file: 'foo.h': No such file or directory (C/C++)C1083D8016 — MSVC: command line error D8016: '/RTC1' and '/O2' command-line options are incompatible (C/C++)D8016file in wrong format — ld: file in wrong format / skipping incompatible libfoo.so when searching (C/C++)file in wrong formatLNK1104 — MSVC: fatal error LNK1104: cannot open file 'foo.lib' (or 'app.exe' while it is running) (C/C++)LNK1104LNK1112 — MSVC: fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64' (C/C++)LNK1112LNK2001 — MSVC: error LNK2001: unresolved external symbol / LNK1120: unresolved externals (C/C++)LNK2001LNK2005 — MSVC: error LNK2005: already defined in main.obj / LNK1169: one or more multiply defined symbols found (C/C++)LNK2005LNK2038

Explore the map of this error Full error map →

🧠 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.