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.
205 risultati
Sfoglia la documentazione →C1010: Il nome non corrisponde all'impostazione.
The include must name the file set in Precompiled Header File , exactly.
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.
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.
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.
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.
C1083: Il percorso nella direttiva è sbagliato.
Check the folder names in #include "lib/file.h" against the directory you added.
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\)" .
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.
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…
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 .
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.
C2011: Due intestazioni definiscono lo stesso tipo.
Mantieni una sola definizione, in un'intestazione, e includila dall'altra.
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.
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 .
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.
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.
C2039: L'intestazione che lo dichiara non è inclusa.
std::filesystem needs , std::optional needs : include the header of what you use.
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.
C2039: Il nome del membro è scritto in modo errato.
Check the spelling and the case, for example push_back .
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 .