question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line could not be parsed error when opening a file which includes wxWidgets

See original GitHub issue

Bug 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:

  1. Create a file that includes `“wx/wx.h” (make sure wxWidgets is installed)
  2. 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"
		],
  1. Open file that includes the wxWidgets header
  2. 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MonJampcommented, Jul 13, 2020

That works a lot better than enabling Ignore Parse Errors, I don’t get any extension errors with just enabling those warnings.

0reactions
jbendencommented, Jul 13, 2020

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:

    "c-cpp-flylint.clang.warnings": [
        "all",
        "extra"
    ]
Read more comments on GitHub >

github_iconTop Results From Across the Web

wxXmlDocument reeeeeally slow - wxWidgets Discussion ...
Hi, All of a sudden my app has started loading XML documents (using wxXmlDocument) reeeeeeally slow. Nothing has changed with my app (at ......
Read more >
no data in wxStringOutputStream when writing
Error: XML parsing error: 'no element found' at line 1. Can someone locate where the problem is, since I have been fiddling with...
Read more >
Trying to display the filename passed to program
C:\wxWidgets-2.8.9\BuildCVS.txt it will only pass C:\wxWidgets-2.8.9\ . This is the first time I've worked with command line parsing in any ...
Read more >
FAQ for IDE related issues v2 - wxWidgets Discussion Forum
"Cannot open include file: "wx/setup.h"... " This error is very common amongst people new to wxWidgets, using VS6 or VS7 or anything else...
Read more >
externaly opening a file in shell assosiated program
the app will launch, but it'll say it can't open the file, if I don't modify the command provided, it will open the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found