Skip to content

identifier "NULL" is undefined #1233

@alexmarkley

Description

@alexmarkley

Even though I've included the appropriate headers (and my code compiles without issue) I am getting red squiggles under standard C library symbols in my C++ code. Immediately obvious ones inside my codebase are "NULL", "fprintf", and "stderr"

screenshot from 2017-11-10 07-38-45

  • Operating System and version
    • Fedora 26
  • VS Code version and if you are using the Insiders build
    • About box says 1.17.2. Not an insiders build -- just using the regular yum repository.
  • C/C++ extension version
    • 0.14.2
  • Other extensions you installed and if the issue persists after disabling them
    • "CMake", "CMake Tools"
  • step-by-step instructions to reproduce the issue
    • Open the project, observe red squiggles.
  • A small code sample, zipped up project, or open source repo we can use to verify the bug
  • Relevant settings from your settings.json, c_cpp_properties.json, and/or launch.json files
    • "C_Cpp.intelliSenseEngine": "Default" (If I use "Tag Parser" I do not get the red squiggles.)
  • Any log messages present in the Output window (use "C_Cpp.loggingLevel": "Information" in settings.json)
IntelliSense Engine = Default.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
Autocomplete is enabled.
Error squiggles are enabled.
File exclude: **/.git
File exclude: **/.svn
File exclude: **/.hg
File exclude: **/CVS
File exclude: **/.DS_Store
File exclude: **/.vscode
Search exclude: **/node_modules
Search exclude: **/bower_components
Search exclude: **/.vscode
Code browsing service initialized
  Folder: /usr/local/include/ will be indexed
  Folder: /usr/include/ will be indexed
  Folder: /home/alex/Documents/MarkleyBros/yer-face/ will be indexed
Discovering files...
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/MarkerMapper.cpp
  Processing folder (recursive): /usr/local/include/
  Processing folder (recursive): /usr/include/
  Processing folder (recursive): /home/alex/Documents/MarkleyBros/yer-face/
  Indexing: 22862 file(s) processed
  Indexing: 1 file(s) removed from database
Unable to determine real path of /home/alex/Documents/MarkleyBros/yer-face/build/.cmserver.2988. Error = 2
Done discovering files.
Parsing open files...
Done parsing open files.
Checking for edits and parsing remaining files...
  Processing folder (recursive): /home/alex/Documents/MarkleyBros/yer-face/
  Parsing: 617 files(s) processed
Done parsing remaining files.
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/FaceTracker.cpp
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/Utilities.hpp
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/Utilities.cpp
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/MarkerTracker.hpp
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/MarkerTracker.cpp
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/EyeTracker.hpp
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/TrackerState.hpp
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/Metrics.hpp
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/MarkerType.hpp
Shutting down IntelliSense server: /home/alex/Documents/MarkleyBros/yer-face/src/MarkerMapper.cpp
Checking for syntax errors: file:///home/alex/Documents/MarkleyBros/yer-face/src/MarkerType.cpp
Shutting down IntelliSense server: /home/alex/Documents/MarkleyBros/yer-face/src/FaceTracker.cpp
Shutting down IntelliSense server: /home/alex/Documents/MarkleyBros/yer-face/src/Utilities.cpp
Shutting down IntelliSense server: /home/alex/Documents/MarkleyBros/yer-face/src/yer-face.cpp
Shutting down IntelliSense server: /home/alex/Documents/MarkleyBros/yer-face/src/MarkerTracker.cpp
Shutting down IntelliSense server: /home/alex/Documents/MarkleyBros/yer-face/src/MarkerType.cpp
Shutting down IntelliSense server: /home/alex/Documents/MarkleyBros/yer-face/src/Utilities.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions