Error messages seems to be faulty
René J.V. Bertin
rjvbertin at gmail.com
Mon May 10 10:45:12 BST 2021
On Monday May 10 2021 15:56:08 Simon Walter wrote:
>I use make, so this may not apply to Cmake. I think there is Cmake
>support. For includes, have a look at Project -> Open Configuration
Yes, when using CMake you'll get less of these errors because CMake will add the necessary -I header searchpath elements to each and every compiler invocation. KDevelop will use those commandlines for parsing the files in question. Of course does this with whatever libclang it was built against. If your actual clang compiler uses a different version - or worse, if the clang driver/wrapper adds search paths that its libclang doesn't know about, then of course KDevelop will not necessarily find the same headerfiles and may thus signal errors that aren't there.
Another good way to mess up the parser is "injection" of a headerfile via the compiler arguments.
If any of the devs are reading this: how about loading libclang dynamically, is the number of symbols used from libclang small enough to make such a change doable? If so, would it be conceivable to make the libclang version to use project-specific? Wouldn't that be a better approach to getting parsing output that's really relevant to the compiler you'll be using (assuming it's clang...) than setting the compiler somewhere in the project settings?
More information about the KDevelop