CppPilot

C++ / Dokumentationssuche

Den Fehler finden. Den nächsten Schritt finden.

Suchen Sie nach Diagnosecode, kopierter Meldung oder Symptom. Filtern Sie nach Inhalt und Projektsystem.

  1. Beispiele und DiagrammeMSBuild + CMake

    C1010: Der Name stimmt nicht mit der Einstellung überein.

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

  2. Beispiele und DiagrammeMSBuild + CMake

    C1083: Eine Abhängigkeit oder ein SDK ist nicht installiert.

    Installieren Sie für Windows- oder Standard-Header das Windows SDK oder die C++-Workload im Visual Studio Installer; eine Bibliothek stellen Sie wieder her, zum Beispiel mit vcpkg.

  3. Beispiele und DiagrammeMSBuild + CMake

    C1083: Es ist für eine andere Konfiguration oder Plattform festgelegt.

    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. Beispiele und DiagrammeMSBuild + CMake

    C1083: Sein Ordner ist kein Include-Verzeichnis.

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

  5. Beispiele und DiagrammeMSBuild + CMake

    C1083: Bei Anführungszeichen und spitzen Klammern wird unterschiedlich gesucht.

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

  6. Beispiele und DiagrammeMSBuild + CMake

    C1083: Der Pfad in der Direktive ist falsch.

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

  7. Beispiele und DiagrammeMSBuild + CMake

    C2001: Ein Pfad endet mit einem Backslash.

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

  8. Beispiele und DiagrammeMSBuild + CMake

    C2001: Das schließende Anführungszeichen fehlt.

    Schließen Sie die Zeichenfolge in derselben Zeile. Um eine lange Zeichenfolge fortzusetzen, schließen Sie sie und öffnen Sie eine weitere in der nächsten Zeile: Benachbarte Literale werden verbunden.

  9. Beispiele und DiagrammeMSBuild + CMake

    C2001: Die Datei ist UTF-8 und enthält Nicht-ASCII-Zeichen.

    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. Beispiele und DiagrammeMSBuild + CMake

    C2011: windows.h wird vor winsock2.h eingebunden.

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

  11. Beispiele und DiagrammeMSBuild + CMake

    C2011: Ein Header hat keinen Include-Guard.

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

  12. Beispiele und DiagrammeMSBuild + CMake

    C2011: Zwei Header definieren denselben Typ.

    Behalten Sie eine einzige Definition in einem Header und binden Sie diesen Header im anderen ein.

  13. Beispiele und DiagrammeMSBuild + CMake

    C2027: Ein std::unique_ptr-Member verweist auf einen unvollständigen Typ.

    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. Beispiele und DiagrammeMSBuild + CMake

    C2027: Eine Klasse enthält ein Objekt ihres eigenen Typs.

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

  15. Beispiele und DiagrammeMSBuild + CMake

    C2027: Der Code verwendet einen Member einer vorab deklarierten Klasse.

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

  16. Beispiele und DiagrammeMSBuild + CMake

    C2027: Zwei Header binden sich gegenseitig ein.

    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. Beispiele und DiagrammeMSBuild + CMake

    C2039: Der Header, der ihn deklariert, ist nicht eingebunden.

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

  18. Beispiele und DiagrammeMSBuild + CMake

    C2039: Der Member gehört zu einer anderen Klasse.

    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. Beispiele und DiagrammeMSBuild + CMake

    C2039: Der Membername ist falsch geschrieben.

    Check the spelling and the case, for example push_back .

  20. Beispiele und DiagrammeMSBuild + CMake

    C2039: Der Member erfordert einen neueren C++-Standard.

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