C++ / Documentation search
Find the error. Find the next step.
Search by diagnostic code, copied message, or symptom. Filter by content and project system.
176 results
Browse documentation →Precompiled headers in Visual Studio
How to set up a precompiled header (pch.h, /Yc and /Yu) in a Visual Studio C++ project, what to put in it, and how to fix its errors.
C1004: unexpected end-of-file found
Fix C1004 unexpected end-of-file in MSVC: unbalanced braces in a class, a namespace, or a header.
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.
C1083: cannot open include file
Fix C1083 cannot open include file in Visual Studio: include directories, configurations, quotes, and missing SDKs.
C2001: newline in constant
Fix C2001 newline in constant in MSVC: unterminated strings, backslashes in paths, and UTF-8 source files without a BOM.
C2011: type redefinition
Fix C2011 type redefinition in MSVC: include guards, duplicate definitions, and winsock.h against winsock2.h.
C2027: use of undefined type
Fix C2027 use of undefined type in MSVC: forward declarations, incomplete types, circular includes, and unique_ptr members.
C2039: is not a member of
Fix C2039 is not a member of in MSVC: typos, missing headers, the C++ language standard, and members of another class.
C2061: syntax error: identifier
Fix C2061 syntax error identifier in MSVC: unknown types in parameter lists, circular includes, and typename in templates.
C2065: undeclared identifier
What C2065 undeclared identifier means in MSVC and how to fix typos, missing headers, namespaces, and precompiled header mistakes.
C2084: function already has a body
Fix C2084 function already has a body in MSVC: headers included twice, definitions in a class and outside it, and .cpp includes.
C2143: syntax error: missing ';' before
Fix C2143 syntax error missing ';' in MSVC: unknown type names, a class without its closing semicolon, and circular includes.
C2259: cannot instantiate abstract class
Fix C2259 cannot instantiate abstract class in MSVC: pure virtual functions not overridden and signatures that do not match.
C2280: attempting to reference a deleted function
Fix C2280 attempting to reference a deleted function: copies of non-copyable types such as unique_ptr, mutex, and thread.
C2440: cannot convert
Fix C2440 cannot convert in MSVC: string literals, const pointers, void pointers, and enum class values.
C2512: no appropriate default constructor available
Fix C2512 no appropriate default constructor in MSVC: user constructors, members and base classes, and std::map operator[].
C2664: cannot convert argument
Fix C2664 cannot convert argument in MSVC: Unicode strings, references to temporaries, and const arguments.
C3861: identifier not found
Fix C3861 identifier not found in MSVC: functions called before their declaration, missing headers, and namespaces.
C4244: conversion, possible loss of data
Fix warning C4244 possible loss of data in MSVC: floating-point to integer and wide to narrow integer conversions.
C4267: conversion from 'size_t', possible loss of data
Fix warning C4267 conversion from size_t to int in x64 builds: container sizes, loop indexes, and Windows API lengths.