implicit #include statement
-
Hi all -
A co-worker of mine asked whether Creator had the ability to include a given header file implicitly (with no #include statement in the code). This would be of use when using Creator as an editor/code browser for cross development purposes. The target uses cmake and menuconfig; it would be convenient to be able to implicitly include the sckconfig.h file that menuconfig creates, to eliminate spurious errors in Creator's editor.
Any ideas?
-
Hi
Do you mean as include for the clang code completion?
OR as a normal include for the code itself so the Creator should pretend that
any .h or .cpp file had a #include " sckconfig.h"Creator does support cmake so its not possible to use that directly ?
It sounds that you dont compile in creator so I wonder if they error you see are "just"
from the code model plugin showing error/warnings in the side bar? -
@mzimmers
Ok, i assume you are using the clang code model and its those errors you see then.
I fully understand why you want it.If you look at
https://doc.qt.io/qtcreator/creator-clang-codemodel.html
and section
Using Compilation DatabasesI tried enabling the
Compilation Database Project Manager (plugin) and run the Generate Database from the build menu.
It said
Clang compilation database generated at "xxxDebug\compile_commands.json".I was wondering if we somehow can add your file to this database and Creator could use the symbol from it.
Not that i ever tried this :)