C++ / Documentation search
Find the error. Find the next step.
Search by diagnostic code, copied message, or symptom. Filter by content and project system.
31 results
Browse documentation →Upgrade an old C++ project to a newer Visual Studio
Move a C++ project from an older Visual Studio to Visual Studio 2022 or 2026: retarget the toolset and SDK, then fix the new errors.
C1010: unexpected end of file while looking for precompiled header
Fix C1010 in Visual Studio: include the precompiled header first, or turn precompiled headers off for that file.
LNK1112: module machine type conflicts with target machine type
Fix LNK1112 module machine type x64 conflicts with x86: libraries and object files built for another platform.
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.
MSB8020: build tools cannot be found
Fix MSB8020 in Visual Studio: install the missing platform toolset or retarget the project to the installed one.
MSB8036: Windows SDK version not found
Fix MSB8036: install the Windows SDK version the project asks for, or retarget it to an installed one.
Check your build settings
CppPilot finds inconsistent, accidental, slow, and outdated settings in Visual Studio C++ solutions, property sheets included.
MSVC runtime library options: /MD and /MT
Microsoft's reference for selecting the dynamic or static C runtime, with the corresponding Debug variants.
C1010: The file does not include the precompiled header.
Add #include "pch.h" , or stdafx.h in older projects, as the first line of the file.
C1010: The file should not use it.
For C files and third-party sources, set C/C++ > Precompiled Headers > Precompiled Header to Not Using Precompiled Headers in that file's properties.
C1010: The name does not match the setting.
The include must name the file set in Precompiled Header File , exactly.
Check your build settings: Each finding points to the line to change
Findings name the property, the configuration, and the file and line where it is set, a property sheet included. The AI reviews and explains each one, and Fix review findings can correct the project files after your approval. The analysis…
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…
LNK1112: A library was built for the other platform.
Link the x64 build of the library in x64 configurations and the x86 one in Win32, with platform-specific paths in Linker > General > Additional Library Directories , such as lib\$(PlatformTarget) .
LNK1112: Old object files remain in a shared folder.
When Win32 and x64 share the intermediate directory, objects of one platform are linked into the other: include $(Platform) in Intermediate Directory and rebuild.
LNK1112: The target machine is set by hand.
Set Linker > Advanced > Target Machine back to Not Set , or remove /MACHINE from the additional options.
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: 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 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.