C++ / Documentation search
Find the error. Find the next step.
Search by diagnostic code, copied message, or symptom. Filter by content and project system.
205 results
Browse documentation →Speed up C++ builds in Visual Studio: Keep Debug builds light
Whole Program Optimization ( /GL and /LTCG ) belongs in Release only: in Debug it delays all code generation to the link. Linker > General > Enable Incremental Linking should be Yes in Debug, so that a small change relinks quickly. Give…
Upgrade an old C++ project to a newer Visual Studio: Fix the stricter compiler
Newer compilers follow the standard more closely, and new projects turn conformance mode ( /permissive- ) on. Expect errors on code that older versions accepted: string literals assigned to char* ( C2440 ); missing typename before dependent…
Upgrade an old C++ project to a newer Visual Studio: Retarget the toolset and the SDK
Right-click the solution and choose Retarget solution , or set General > Platform Toolset (v143 for Visual Studio 2022) and General > Windows SDK Version ( 10.0 (latest installed version) ) in every project and configuration. A toolset or…
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…