Line could not be parsed error when opening a file which includes wxWidgets
See original GitHub issueBug description
Using clang when parsing a file which includes the wxWidgets header "wx/wx.h", I get an error which says Line could not be parsed. This causes the lint tool to be stopped and any warnings in code disappears.
Here is the full error that is reported:
vscode-c-cpp-flylint: 'Line could not be parsed: _WX_DECLARE_HASHTABLE'' while validating: /home/filjo/Documents/Code/MonPad/MonPad.cpp. Please analyze the 'C/C++ FlyLint' Output console. Stacktrace: Error: Line could not be parsed: _WX_DECLARE_HASHTABLE'
at /home/filjo/.vscode/extensions/jbenden.c-cpp-flylint-1.4.4/server/linters/linter.js:222:31
at Array.forEach (<anonymous>)
at Clang.parseLines (/home/filjo/.vscode/extensions/jbenden.c-cpp-flylint-1.4.4/server/linters/linter.js:206:15)
at Clang.lint (/home/filjo/.vscode/extensions/jbenden.c-cpp-flylint-1.4.4/server/linters/linter.js:196:21)
at /home/filjo/.vscode/extensions/jbenden.c-cpp-flylint-1.4.4/server/server.js:262:43
at Array.forEach (<anonymous>)
at /home/filjo/.vscode/extensions/jbenden.c-cpp-flylint-1.4.4/server/server.js:259:21
at Generator.next (<anonymous>)
at fulfilled (/home/filjo/.vscode/extensions/jbenden.c-cpp-flylint-1.4.4/server/server.js:5:58)
In the log output there are many warnings (although this is kinda normal with wxWidgets) but I don’t see any errors. Last line after clang lint is done analyzing is ... 12744 more items. So there might be an error somewhere but I don’t know how to find the full log.
Steps to reproduce
Steps to reproduce the behavior:
- Create a file that includes `“wx/wx.h” (make sure wxWidgets is installed)
- Add relevant include paths and defines. In Fedora that looks like:
"c-cpp-flylint.clang.includePaths": [
"/usr/include/wx-3.0/",
"/usr/lib64/wx/include/gtk3-unicode-3.0/"
],
"c-cpp-flylint.clang.defines": [
"__WXGTK__",
"WXUSINGDLL",
"_FILE_OFFSET_BITS=64"
],
- Open file that includes the wxWidgets header
- See error
Additional Notes
I’m pretty sure this is a bug with this extension. Clang should be able to parse wxWidgets source just fine also in the log it doesn’t say that clang returned with null or any other error message. If this is a Clang error it would be nice if the extension could return the exact Clang error to make it easier to debug.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
That works a lot better than enabling
Ignore Parse Errors, I don’t get any extension errors with just enabling those warnings.Thank you for the logs.
Unfortunately, looks like wxWidgets is a pain mess… 😃
You could try the setting below and disabling the ignore parse errors: