CppPilot

C++ / Documentation search

Find the error. Find the next step.

Search by diagnostic code, copied message, or symptom. Filter by content and project system.

  1. Examples and diagramsMSBuild + CMake

    C1010: The name does not match the setting.

    The include must name the file set in Precompiled Header File , exactly.

  2. Examples and diagramsMSBuild + CMake

    C1083: A dependency or an SDK is not installed.

    For Windows or standard headers, install the Windows SDK or the C++ workload in the Visual Studio Installer; for a library, restore it, for example with vcpkg.

  3. Examples and diagramsMSBuild + CMake

    C1083: It is set for another configuration or platform.

    Settings made for Debug or Win32 only do not apply to Release or x64: select All Configurations and All Platforms when you add the directory.

  4. Examples and diagramsMSBuild + CMake

    C1083: Its folder is not an include directory.

    Add it to C/C++ > General > Additional Include Directories , relative to the project with $(ProjectDir) or $(SolutionDir) rather than as an absolute path.

  5. Examples and diagramsMSBuild + CMake

    C1083: Quotes and angle brackets search differently.

    #include "file.h" looks first next to the including file; <file.h> only in the include directories.

  6. Examples and diagramsMSBuild + CMake

    C1083: The path in the directive is wrong.

    Check the folder names in #include "lib/file.h" against the directory you added.

  7. Examples and diagramsMSBuild + CMake

    C2001: A path ends with a backslash.

    In "C:\Data\" , \" is an escaped quote. Double the backslashes, or write a raw string: R"(C:\Data\)" .

  8. Examples and diagramsMSBuild + CMake

    C2001: The closing quote is missing.

    Close the string on the same line. To continue a long string, close it and open another one on the next line: adjacent literals are joined.

  9. Examples and diagramsMSBuild + CMake

    C2001: The file is UTF-8 and contains non-ASCII characters.

    Without a BOM, MSVC reads the file in the system code page, and on Chinese, Japanese, or Korean Windows a multi-byte character can absorb the closing quote. Add /utf-8 to C/C++ > Command Line > Additional Options , or save the file as UTF-8…

  10. Examples and diagramsMSBuild + CMake

    C2011: windows.h is included before winsock2.h .

    windows.h includes the old winsock.h , which redefines sockaddr : include winsock2.h first, or define WIN32_LEAN_AND_MEAN before windows.h .

  11. Examples and diagramsMSBuild + CMake

    C2011: A header has no include guard.

    Add #pragma once at the top of the header, so that including it twice defines its types once.

  12. Examples and diagramsMSBuild + CMake

    C2011: Two headers define the same type.

    Keep one definition, in one header, and include it from the other.

  13. Examples and diagramsMSBuild + CMake

    C2027: A std::unique_ptr member points to an incomplete type.

    With the pimpl idiom, the destructor must be defined where the type is complete: declare ~Owner(); in the header and define Owner::~Owner() = default; in the .cpp file, after the include.

  14. Examples and diagramsMSBuild + CMake

    C2027: A class contains an object of its own type.

    A class cannot contain itself by value: use a pointer or a container such as std::vector .

  15. Examples and diagramsMSBuild + CMake

    C2027: The code uses a member of a forward-declared class.

    Include the header that defines the class in the .cpp file that calls its members, creates it, or copies it.

  16. Examples and diagramsMSBuild + CMake

    C2027: Two headers include each other.

    Keep the forward declaration in one header, move the code that uses the members to the .cpp file, and include the full header there.

  17. Examples and diagramsMSBuild + CMake

    C2039: The header that declares it is not included.

    std::filesystem needs <filesystem> , std::optional needs <optional> : include the header of what you use.

  18. Examples and diagramsMSBuild + CMake

    C2039: The member belongs to another class.

    Check the expression's static type. A base-class reference does not expose a member declared only by a derived class. Access through a pointer uses -> , but incorrect pointer syntax can produce a different diagnostic.

  19. Examples and diagramsMSBuild + CMake

    C2039: The member name is misspelled.

    Check the spelling and the case, for example push_back .

  20. Examples and diagramsMSBuild + CMake

    C2039: The member needs a newer C++ standard.

    std::filesystem needs C++17, starts_with C++20: set C/C++ > Language > C++ Language Standard .