A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
msvcprtd.lib is the Microsoft C++ Standard Library debug import library. It is selected when the project uses the Debug DLL runtime setting, which corresponds to /MDd.
Visual Studio looks for it because the project or one of the linked objects was built with a runtime-library setting that requires the debug C++ standard library. The CRT/STL library mapping is:
-
msvcprt.lib→/MD -
msvcprtd.lib→/MDd -
libcpmt.lib→/MT -
libcpmtd.lib→/MTd
msvcportlib.lib is not the standard Microsoft library name shown in the documentation. If the actual linker error is msvcprtd.lib, focus on runtime-library and toolset configuration.
To fix the project configuration:
- Check the Runtime Library setting
In the project properties, make sure the runtime setting matches the build configuration being used.- Debug commonly uses
/MDd - Release commonly uses
/MD
- Debug commonly uses
- Make sure the required MSVC libraries are installed
If a standard Microsoft library such asmsvcprtd.libcannot be opened, verify that the required Visual Studio C++ components and Windows SDK are installed. If needed, modify the Visual Studio installation and add the missing C++ libraries/toolsets. - Verify Platform Toolset and Windows SDK Version
In the project’s General property page, confirm that the selected Platform Toolset and Windows SDK Version are installed. - Check library search paths
If library directories are incorrect or stale, the linker may fail to find standard libraries.- Verify VC++ Directories > Library Directories
- Verify Linker > General > Additional Library Directories
- For command-line builds, verify the
LIBenvironment variable
- Make sure all libraries use compatible settings
If GLFW, GLAD, or any other library was built with different compiler/runtime settings, linker problems can occur. Avoid mixing libraries built with different compiler versions or different runtime-library settings. Build all components with the same compiler toolset and compatible runtime settings. - Check architecture match
Ensure the project and all linked libraries are built for the same architecture, such as x64 with x64. - Clean and rebuild
An out-of-date object or library can also cause linker mismatches. Perform a clean build before further changes.
If the project is intended to use the debug DLL runtime, the usual root causes are:
- missing MSVC C++ toolset components,
- incorrect library directories,
- mismatched toolset/runtime settings across project and libraries.