C++ / Documentation search
Find the error. Find the next step.
Search by diagnostic code, copied message, or symptom. Filter by content and project system.
47 results
Browse documentation →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.
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.
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.
LNK4098: A Release library is linked in Debug.
Link the Debug build of the library in the Debug configuration.
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.
Use vcpkg libraries in Visual Studio: Add a library
In the Developer PowerShell, in the project folder, run vcpkg new --application . It creates vcpkg.json and vcpkg-configuration.json . Add the libraries: vcpkg add port fmt . In the project properties, set vcpkg > Use Vcpkg Manifest to Yes.…
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…