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

    C2039: L'intestazione che lo dichiara non è inclusa.

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

  2. Esempi e diagrammiMSBuild + CMake

    C2039: Il membro appartiene a un'altra classe.

    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.

  3. Esempi e diagrammiMSBuild + CMake

    C2039: Il nome del membro è scritto in modo errato.

    Check the spelling and the case, for example push_back .

  4. Esempi e diagrammiMSBuild + CMake

    C2039: Il membro richiede uno standard C++ più recente.

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

  5. Esempi e diagrammiMSBuild + CMake

    C2061: un tipo dipendente in un modello non ha typename .

    Write typename T::value_type : inside a template, a name that depends on a template parameter is not a type unless you say so.

  6. Esempi e diagrammiMSBuild + CMake

    C2061: Il tipo non è dichiarato in quel punto.

    Include its header before the declaration, or qualify it with its namespace, for example std::string .

  7. Esempi e diagrammiMSBuild + CMake

    C2061: Due intestazioni si includono a vicenda.

    With a circular include, the type is not declared yet. Forward-declare it ( class Widget; ) when the function takes a pointer or a reference, and include the header in the .cpp file.

  8. Esempi e diagrammiMSBuild + CMake

    C2065: Il codice precede l'intestazione precompilata.

    With precompiled headers, everything before #include "pch.h" is ignored. Make it the first line of the file.

  9. Esempi e diagrammiMSBuild + CMake

    C2065: La dichiarazione è esclusa dal preprocessore.

    Check the #if or #ifdef around it and the preprocessor definitions of the configuration.

  10. Esempi e diagrammiMSBuild + CMake

    C2065: La dichiarazione si trova in un altro ambito o arriva dopo.

    Una variabile dichiarata all'interno di un blocco o di un ciclo non esiste più dopo di esso, e un nome deve essere dichiarato prima del suo primo utilizzo.

  11. Esempi e diagrammiMSBuild + CMake

    C2065: L'intestazione che lo dichiara non è inclusa.

    Includila nel file che usa il nome, invece di affidarti a un'altra intestazione che la includa.

  12. Esempi e diagrammiMSBuild + CMake

    C2065: Il nome è scritto in modo errato.

    C++ is case-sensitive: Count and count are different names.

  13. Esempi e diagrammiMSBuild + CMake

    C2065: Il nome si trova in uno spazio dei nomi.

    Write std::cout , or add a using declaration.

  14. Esempi e diagrammiMSBuild + CMake

    C2084: è incluso un file .cpp.

    Include headers, never .cpp files.

  15. Esempi e diagrammiMSBuild + CMake

    C2084: Una funzione viene definita nella classe e di nuovo all'esterno.

    Keep one definition: either the body in the class, or a declaration in the class and the body in the .cpp file.

  16. Esempi e diagrammiMSBuild + CMake

    C2084: Un'intestazione che definisce funzioni non ha una protezione di inclusione.

    Add #pragma once to the header.

  17. Esempi e diagrammiMSBuild + CMake

    C2143: Una definizione di classe o struttura non termina con ; .

    Write }; after the closing brace. The error then appears on the first line after the class, often in another file that includes the header.

  18. Esempi e diagrammiMSBuild + CMake

    C2143: Il nome di un tipo è sconosciuto.

    In Widget* widget; , if Widget is not declared, the compiler reads it as a variable and expects ; before * . Include its header, qualify it with its namespace, or forward-declare it ( class Widget; ).

  19. Esempi e diagrammiMSBuild + CMake

    C2143: L'istruzione precedente non è terminata.

    Look at the line before the one reported: a missing ; , an unclosed parenthesis, or a macro that expands to something unexpected.

  20. Esempi e diagrammiMSBuild + CMake

    C2143: Due intestazioni si includono a vicenda.

    Una delle due classi non è ancora dichiarata quando l'altra la usa. Sostituisci un'inclusione con una dichiarazione anticipata dove basta un puntatore o un riferimento.