CppPilot

C++ / Ricerca nella documentazione

Trova l'errore. Trova il passo successivo.

Cerca per codice diagnostico, messaggio copiato o sintomo. Filtra per contenuto e sistema di progetto.

  1. Esempi e diagrammiMSBuild + CMake

    C1004: Una macro nasconde una parentesi graffa.

    A macro that opens a block, such as BEGIN_MESSAGE_MAP , needs its closing macro.

  2. Esempi e diagrammiMSBuild + CMake

    C1004: Un'intestazione inclusa lascia un blocco aperto.

    A header that ends inside a namespace or an extern "C" { moves the error to the file that includes it: check the headers included last.

  3. Esempi e diagrammiMSBuild + CMake

    C1010: Il file non include l'intestazione precompilata.

    Add #include "pch.h" , or stdafx.h in older projects, as the first line of the file.

  4. Esempi e diagrammiMSBuild + CMake

    C1010: Il file non dovrebbe utilizzarlo.

    For C files and third-party sources, set C/C++ > Precompiled Headers > Precompiled Header to Not Using Precompiled Headers in that file's properties.

  5. Esempi e diagrammiMSBuild + CMake

    C1010: Il nome non corrisponde all'impostazione.

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

  6. Esempi e diagrammiMSBuild + CMake

    C1083: Una dipendenza o un SDK non è installato.

    Per le intestazioni di Windows o standard, installa Windows SDK o il carico di lavoro C++ nel Visual Studio Installer; per una libreria, ripristinala, ad esempio con vcpkg.

  7. Esempi e diagrammiMSBuild + CMake

    C1083: È impostato per un'altra configurazione o piattaforma.

    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.

  8. Esempi e diagrammiMSBuild + CMake

    C1083: La sua cartella non è una directory di inclusione.

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

  9. Esempi e diagrammiMSBuild + CMake

    C1083: Le virgolette e le parentesi angolari cercano in modo diverso.

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

  10. Esempi e diagrammiMSBuild + CMake

    C1083: Il percorso nella direttiva è sbagliato.

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

  11. Esempi e diagrammiMSBuild + CMake

    C2001: Un percorso termina con una barra rovesciata.

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

  12. Esempi e diagrammiMSBuild + CMake

    C2001: Manca la virgoletta di chiusura.

    Chiudi la stringa sulla stessa riga. Per continuare una stringa lunga, chiudila e aprine un'altra sulla riga successiva: i letterali adiacenti vengono uniti.

  13. Esempi e diagrammiMSBuild + CMake

    C2001: Il file è UTF-8 e contiene caratteri non ASCII.

    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…

  14. Esempi e diagrammiMSBuild + CMake

    C2011: windows.h è incluso prima di 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 .

  15. Esempi e diagrammiMSBuild + CMake

    C2011: Un'intestazione non ha una protezione di inclusione.

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

  16. Esempi e diagrammiMSBuild + CMake

    C2011: Due intestazioni definiscono lo stesso tipo.

    Mantieni una sola definizione, in un'intestazione, e includila dall'altra.

  17. Esempi e diagrammiMSBuild + CMake

    C2027: un membro std::unique_ptr punta a un tipo incompleto.

    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.

  18. Esempi e diagrammiMSBuild + CMake

    C2027: Una classe contiene un oggetto del proprio tipo.

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

  19. Esempi e diagrammiMSBuild + CMake

    C2027: Il codice usa un membro di una classe dichiarata in anticipo.

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

  20. Esempi e diagrammiMSBuild + CMake

    C2027: Due intestazioni si includono a vicenda.

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