CppPilot

C++ / Documentation search

Find the error. Find the next step.

Search by diagnostic code, copied message, or symptom. Filter by content and project system.

  1. Examples and diagramsMSBuild + CMake

    C3861: The function is in a namespace.

    Qualify it, for example std::sort or utils::Compute .

  2. Examples and diagramsMSBuild + CMake

    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.

  3. Examples and diagramsMSBuild + CMake

    C3861: The header that declares it is not included.

    Include it: std::max needs <algorithm> , printf needs <cstdio> .

  4. Examples and diagramsMSBuild + CMake

    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.

  5. Examples and diagramsMSBuild + CMake

    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) .

  6. Examples and diagramsMSBuild + CMake

    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.

  7. Examples and diagramsMSBuild + CMake

    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 .

  8. Examples and diagramsMSBuild + CMake

    C4267: An API needs an int or a DWORD .

    Check that the size fits, then cast explicitly: static_cast<int>(text.size()) .

  9. Examples and diagramsMSBuild + CMake

    C4430: A function has no return type.

    Write it, for example void or int : C++ has no default int .

  10. Examples and diagramsMSBuild + CMake

    C4430: The type is in a namespace.

    Qualify it, for example std::string .

  11. Examples and diagramsMSBuild + CMake

    C4430: The type is not declared yet.

    Include the header that declares it, before the line that uses it.

  12. Examples and diagramsMSBuild + CMake

    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.

  13. Examples and diagramsMSBuild + CMake

    C4996: A POSIX name is used.

    Functions such as open or strdup have ISO C++ names with an underscore: _open , _strdup .

  14. Examples and diagramsMSBuild + CMake

    C4996: A string function can overflow its buffer.

    Prefer std::string , or the bounded functions such as strcpy_s and snprintf .

  15. Examples and diagramsMSBuild + CMake

    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.

  16. Examples and diagramsMSBuild + CMake

    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…

  17. Examples and diagramsMSBuild + CMake

    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…

  18. Examples and diagramsMSBuild + CMake

    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.

  19. Examples and diagramsMSBuild + CMake

    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.

  20. Examples and diagramsMSBuild + CMake

    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.