C++ / Recherche dans la documentation
Trouver l’erreur. Trouver la prochaine étape.
Recherchez par code de diagnostic, message copié ou symptôme. Filtrez par contenu et système de projet.
176 résultats
Parcourir la documentation →C1004 : une macro masque une accolade.
A macro that opens a block, such as BEGIN_MESSAGE_MAP , needs its closing macro.
C1004 : un en-tête inclus laisse un bloc ouvert.
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.
C1010 : le fichier n’inclut pas l’en-tête précompilé.
Add #include "pch.h" , or stdafx.h in older projects, as the first line of the file.
C1010 : ce fichier ne devrait pas l’utiliser.
For C files and third-party sources, set C/C++ > Precompiled Headers > Precompiled Header to Not Using Precompiled Headers in that file's properties.
C1010 : le nom ne correspond pas au réglage.
The include must name the file set in Precompiled Header File , exactly.
C1083 : une dépendance ou un SDK n’est pas installé.
Pour les en-têtes Windows ou standard, installez le SDK Windows ou la charge de travail C++ via Visual Studio Installer ; pour une bibliothèque, restaurez-la, par exemple avec vcpkg.
C1083 : le réglage concerne une autre configuration ou plateforme.
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 : son dossier n’est pas un répertoire d’inclusion.
Add it to C/C++ > General > Additional Include Directories , relative to the project with $(ProjectDir) or $(SolutionDir) rather than as an absolute path.
C1083 : les guillemets et les chevrons n’effectuent pas la même recherche.
#include "file.h" looks first next to the including file; only in the include directories.
C1083 : le chemin de la directive est incorrect.
Check the folder names in #include "lib/file.h" against the directory you added.
C2001 : un chemin se termine par une barre oblique inverse.
In "C:\Data\" , \" is an escaped quote. Double the backslashes, or write a raw string: R"(C:\Data\)" .
C2001 : le guillemet fermant manque.
Fermez la chaîne sur la même ligne. Pour prolonger une chaîne, fermez-la et ouvrez-en une autre à la ligne suivante : les littéraux adjacents sont réunis.
C2001 : le fichier est en UTF-8 et contient des caractères 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 est inclus avant 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 en-tête n’a pas de garde d’inclusion.
Add #pragma once at the top of the header, so that including it twice defines its types once.
C2011 : deux en-têtes définissent le même type.
Conservez une seule définition dans un seul en-tête et incluez celui-ci depuis l’autre.
C2027 : un membre std::unique_ptr pointe vers un type incomplet.
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 : une classe contient un objet de son propre type.
A class cannot contain itself by value: use a pointer or a container such as std::vector .
C2027 : le code utilise un membre d’une classe déclarée par anticipation.
Include the header that defines the class in the .cpp file that calls its members, creates it, or copies it.
C2027 : deux en-têtes s’incluent mutuellement.
Keep the forward declaration in one header, move the code that uses the members to the .cpp file, and include the full header there.