C++ / Documentation search
Find the error. Find the next step.
Search by diagnostic code, copied message, or symptom. Filter by content and project system.
176 results
Browse documentation →C3861: The function is in a namespace.
Qualify it, for example std::sort or utils::Compute .
C3861: The function is inside #ifdef .
Its declaration may be excluded for this configuration or platform: check the preprocessor definitions of the configuration you build.
C3861: The header that declares it is not included.
Include it: std::max needs <algorithm> , printf needs <cstdio> .
C4244: Arithmetic on small types is assigned back.
char and short are promoted to int in expressions: cast the result when you store it in the smaller type.
C4244: The conversion is intended.
Make it explicit with static_cast<int>(value) , and round first when truncation is not what you want: std::lround(value) .
C4244: The destination type is too small.
Use a type that holds the value, for example double for a result that has a fractional part, or int64_t for a large count.
C4267: A size or an index is stored in int .
Use size_t , or auto : for (size_t i = 0; i < items.size(); ++i) , or a range-based for .
C4267: An API needs an int or a DWORD .
Check that the size fits, then cast explicitly: static_cast<int>(text.size()) .
C4430: A function has no return type.
Write it, for example void or int : C++ has no default int .
C4430: The type is in a namespace.
Qualify it, for example std::string .
C4430: The type is not declared yet.
Include the header that declares it, before the line that uses it.
C4430: Two headers include each other.
With a circular include, one class is not declared when the other uses it. Replace the include with a forward declaration ( class Widget; ) where a pointer or a reference is enough.
C4996: A POSIX name is used.
Functions such as open or strdup have ISO C++ names with an underscore: _open , _strdup .
C4996: A string function can overflow its buffer.
Prefer std::string , or the bounded functions such as strcpy_s and snprintf .
C4996: Portable code must keep the standard functions.
Define _CRT_SECURE_NO_WARNINGS in the project's preprocessor definitions, for that project only, rather than disabling C4996 for everything: it also reports your own [[deprecated]] functions.
Fix build errors with AI: Project context sent to the AI
Linker errors often come from settings, not code. CppPilot gives the AI the include directories, preprocessor definitions, C++ standard, runtime library, and linked libraries of the project, as Visual Studio evaluates them for the active…
Fix build errors with AI: Request fixes and check the result
Fix all errors asks the AI to work through the errors in several passes. After each fix, CppPilot rebuilds the C++ project concerned and follows every error through its states: ready, correcting, verifying, resolved, or still present. A fix…
LNK1104: The file is the program itself, and it is still running.
When the message names your .exe or .dll , close the running program or stop debugging; an antivirus scanning the file can also lock it briefly.
LNK1104: The file name contains the wrong configuration or platform.
Check macros such as $(Configuration) and $(Platform) in the dependency name and in the library directories.
LNK1104: The library folder is not in the search path.
Add it to Linker > General > Additional Library Directories for the configuration and platform you build. Paths set only for Debug or only for Win32 are a common trap.