C++ / Documentation search
Find the error. Find the next step.
Search by diagnostic code, copied message, or symptom. Filter by content and project system.
17 results for “runtime library”
Browse documentation →MSVC runtime library options: /MD and /MT
Microsoft's reference for selecting the dynamic or static C runtime, with the corresponding Debug variants.
LNK2005: Runtime library symbols are defined twice.
Symbols already defined in LIBCMT.lib or MSVCRT.lib mean that libraries built with /MT and /MD are mixed: use the same runtime everywhere, as for LNK2038 .
LNK4098: A library uses another runtime library.
Build all projects and libraries with the same C/C++ > Code Generation > Runtime Library : /MD with /MDd in Debug, or /MT with /MTd . Use the library build that matches.
LNK2038: A prebuilt third-party library uses another runtime.
Use the variant built for your runtime, or rebuild it with your settings, for example with the matching vcpkg triplet.
LNK2038: A Release library is linked into a Debug build.
A mismatch on _ITERATOR_DEBUG_LEVEL (0 against 2) means that Debug and Release code are mixed: link the Debug version of the library in Debug builds.
LNK2038: Projects use different runtime libraries.
Set the same C/C++ > Code Generation > Runtime Library in every project of the program: /MD everywhere, or /MT everywhere, with /MDd or /MTd in Debug.
Use vcpkg libraries in Visual Studio
Add C++ libraries to a Visual Studio project with vcpkg in manifest mode, choose the right triplet, and fix the errors it causes.
LNK2005: symbol already defined
Fix LNK2005 already defined in Visual Studio: definitions in headers, included .cpp files, and mixed runtime libraries.
LNK2038: mismatch detected
Fix LNK2038 mismatch detected for RuntimeLibrary or _ITERATOR_DEBUG_LEVEL: make every project and library use the same runtime.
LNK4098: defaultlib conflicts with use of other libs
Fix LNK4098 defaultlib MSVCRT conflicts with use of other libs: link every library with the same C runtime.
Check your build settings
CppPilot finds inconsistent, accidental, slow, and outdated settings in Visual Studio C++ solutions, property sheets included.
Fix build errors with AI
CppPilot explains and fixes MSVC compiler, linker, and MSBuild errors and warnings in Visual Studio, then rebuilds to check each fix.
Check your build settings: Settings checked
Inconsistent: static libraries linked with another runtime library ( LNK2038 ), a Release configuration that builds a Debug project, different toolsets or C++ standards, two projects sharing an intermediate directory or writing the same…
Fix build errors with AI: Project context sent to the AI
Linker errors often come from settings, not code. CppPilot gives the AI the include directories, preprocessor definitions, C++ standard, runtime library, and linked libraries of the project, as Visual Studio evaluates them for the active…
LNK2038: A single file overrides the project.
A .cpp file can have its own Runtime Library setting. Remove the override in its properties so it inherits the project's.
LNK4098: /NODEFAULTLIB hides the conflict.
Ignoring the default library silences the warning without making the runtimes compatible: use it only for a library you know is not needed.
Use vcpkg libraries in Visual Studio: Choose the triplet
The triplet decides how the libraries are built. It must match the runtime library of your project, or the link fails with LNK2038 or LNK4098 : x64-windows : DLLs, with the dynamic runtime ( /MD ), the default. vcpkg copies the DLLs next to…