Runtime: Microsoft C
To understand the CRT today, you must understand its chaotic past. Microsoft has released several incompatible versions of the runtime over the past three decades.
| Scenario | Compatibility |
|----------|---------------|
| MSVC with Intel compiler | Works if both use same UCRT and vcruntime linking model. |
| MSVC with MinGW | Incompatible; MinGW uses its own GNU C runtime (msvcrt.dll historically). |
| MSVC with Clang (Windows target) | Clang can target MSVC’s UCRT (excellent). |
| C# / .NET P/Invoke to C DLL using CRT | Works if CRT DLLs are loaded; ensure calling convention (cdecl/stdcall). |
| Visual Basic 6 calling CRT | Possible but risky; memory ownership issues. | microsoft c runtime
| Model | Output | Pros | Cons |
|-------|--------|------|------|
| Static (/MT or /MTd) | CRT code embedded in .exe/.dll | No external DLL dependency; simpler deployment | Larger binary size; no security updates (unless recompiled) |
| Dynamic (/MD or /MDd) | Links to ucrtbase.dll and vcruntime140.dll | Smaller binaries; OS-level security updates | Requires redistributable (if missing on old Windows) | To understand the CRT today, you must understand
As of Visual Studio 2015, Microsoft introduced the Universal CRT. | Model | Output | Pros | Cons
Microsoft added many non-standard but useful functions (prefix _ or __ to avoid ISO name collisions):