[Qt-creator] Use the clang static analyzer from an imported project

Nikolai Kosjar nikolai.kosjar at qt.io
Mon Oct 16 13:47:41 CEST 2017


On 10/11/2017 02:35 PM, Charlie Turner wrote:
> I've imported an existing project, and configured the
> <project_name>.{includes,files,config} files to the point where I get
> good jump to definition / highlight and such.
> 
> However, when I run the static analyzer, it gives an error,
> 
> error: openssl/aes.h: No such file or directory
>   #include <openssl/aes.h>
>            ^~~~~~~~~~~~~~~
> 
> In the editor, that line is not underlined, it lives in a buildroot
> directory that I have added to my <project_name>.includes file. Is the
> analyzer aware of this information? What else can I try to get it past
> this error?

Note that the clang static analyzer is not really supported [1] for a 
generic project since it usually does not provide enough information for 
clang. However, an invocation of the analyzer is not prohibited since 
you still might get it working (depending on your project...) with the 
correct set of macros/includes.

Checking with Qt Creator 4.4.0 and the current version from the 4.5 
branch, I see that directories from <projectname>.includes are forwarded 
to the analyzer invocation here. If you have something small and 
reproducible, please report and attach it.

Nikolai


[1] 
http://doc.qt.io/qtcreator/creator-clang-static-analyzer.html#supported-project-types-and-tool-chains



More information about the Qt-creator mailing list