Discussion:
[Qt-creator] Qt Creator Clazy Support
Jeff Tranter
2018-03-16 20:48:12 UTC
Permalink
I'm trying to get the new Clazy support in Qt Creator working.

I have Qt Creator 4.6.0 rc1 compiled from source against Qt 5.10.1 on
Ubuntu Linux.

In Tools / Options, under Analyzer, it shows:

Clang executable: clang-5.0
Version: 5.0.0, supported.

Under C++ / Code Model, is says:

"The Clang Code Model is disabled because the corresponding plugin is
not loaded."

Under Help / About Plugins... it shows ClangStaticAnalyzer loaded,
version 4.5.83.

I also have clazy built from git and installed and it runs on its own.

I am able to run the Clang static analyzer from Qt Creator but I can't
seem to run or configure clazy.

Any ideas?

--
Jeff Tranter, Engineering Manager, Integrated Computer Solutions.
Certified Qt Developer, Scrum Master, Scrum Product Owner.
ICS - Creating Smart Devices for a Connected World.
Orgad Shaneh
2018-03-17 17:57:07 UTC
Permalink
On Fri, Mar 16, 2018 at 10:48 PM, Jeff Tranter <***@ics.com> wrote:

> I'm trying to get the new Clazy support in Qt Creator working.
>
> I have Qt Creator 4.6.0 rc1 compiled from source against Qt 5.10.1 on
> Ubuntu Linux.
>
> In Tools / Options, under Analyzer, it shows:
>
> Clang executable: clang-5.0
> Version: 5.0.0, supported.
>
> Under C++ / Code Model, is says:
>
> "The Clang Code Model is disabled because the corresponding plugin is not
> loaded."
>
> Under Help / About Plugins... it shows ClangStaticAnalyzer loaded, version
> 4.5.83.
>
> I also have clazy built from git and installed and it runs on its own.
>
> I am able to run the Clang static analyzer from Qt Creator but I can't
> seem to run or configure clazy.
>
> Any ideas?


You need to enable the ClangCodeModel plugin, not ClangStaticAnalyzer.

- Orgad
Tobias Hunger
2018-03-17 18:09:15 UTC
Permalink
Hi Jeff,

I am no expert on the code model, please correct me if I am wrong!

Even with clang code model support: This will probably not work with the
system-provided clang:-(

The code model uses libclang, which can not load dynamic plugins. So you
need to have the flags plug-in statically linked into clang for it to be
available.

This makes building clang annoying: You need to build clang, then a static
version of flags, and then clang again, linking to the static flags:-(

The simplest thing you can do is probably to grab a pre-build clang from
download.qt.io.

Best Regards,
Tobias
Ivan Donchevskii
2018-03-19 07:41:53 UTC
Permalink
Hi!

In fact we currently build clang only once with all plugins since it has become possible to put clazy in clang/tools/extra folder.

All steps are in our clang build script (https://github.com/qtproject/qtsdk/blob/master/packaging-tools/build_clang.py)


It's still pretty complicated so basically "grab a pre-build clang from download.qt.io<http://download.qt.io/>" :)


Kind regards,

Ivan

________________________________
From: Qt-creator <qt-creator-bounces+ivan.donchevskii=***@qt-project.org> on behalf of Tobias Hunger <***@gmail.com>
Sent: Saturday, March 17, 2018 7:09:15 PM
To: Orgad Shaneh
Cc: qt-creator
Subject: Re: [Qt-creator] Qt Creator Clazy Support

Hi Jeff,

I am no expert on the code model, please correct me if I am wrong!

Even with clang code model support: This will probably not work with the system-provided clang:-(

The code model uses libclang, which can not load dynamic plugins. So you need to have the flags plug-in statically linked into clang for it to be available.

This makes building clang annoying: You need to build clang, then a static version of flags, and then clang again, linking to the static flags:-(

The simplest thing you can do is probably to grab a pre-build clang from download.qt.io<http://download.qt.io>.

Best Regards,
Tobias
Guenter Schwann
2018-03-19 07:53:31 UTC
Permalink
On Montag, 19. März 2018 08:41:53 CET Ivan Donchevskii wrote:
> Hi!
>
> In fact we currently build clang only once with all plugins since it has
> become possible to put clazy in clang/tools/extra folder.

Sidetracking:
I wonder if you could easily put clang-format there as well.
So the beautifier plugin could use that one (as default) to avoid the extra
download/install.

--
Guenter Schwann
Riitta-Leena Miettinen
2018-03-19 08:37:05 UTC
Permalink
Hello,

The documentation for the Clang code model is maybe a little bit hidden away, but you can find it here:

http://doc.qt.io/qtcreator/creator-clang-codemodel.html

Cheers,

Leena


Leena Miettinen
Documentation Engineer

The Qt Company Germany GmbH
Rudower Chaussee 13
D-12489, Berlin, Germany
GeschÀftsfÌhrer: Mika PÀlsi, Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
riitta-***@qt.io
+49 30 63 92 3255
http://qt.io<http://qt.io/>

[http://s3-eu-west-1.amazonaws.com/qt-files/logos/qt_logo_with_text_green_rgb_400x141.png]<http://qt.io/>

[http://s3-eu-west-1.amazonaws.com/qt-files/logos/SoMe/qt_facebook.png]<http://www.facebook.com/Qt>

[http://s3-eu-west-1.amazonaws.com/qt-files/logos/SoMe/qt_twitter.png]<http://www.twitter.com/qtproject>

[http://s3-eu-west-1.amazonaws.com/qt-files/logos/SoMe/qt_linkedin.png]<https://www.linkedin.com/company/the-qt-company/>

[http://s3-eu-west-1.amazonaws.com/qt-files/logos/SoMe/qt_googleplus.png]<https://plus.google.com/104580575722059274792>

[http://s3-eu-west-1.amazonaws.com/qt-files/logos/SoMe/qt_youtube.png]<https://www.youtube.com/QtStudios>










From: Qt-creator [mailto:qt-creator-bounces+riitta-leena.miettinen=***@qt-project.org] On Behalf Of Orgad Shaneh
Sent: Samstag, 17. MÀrz 2018 18:57
To: Jeff Tranter <***@ics.com>
Cc: qt-***@qt-project.org
Subject: Re: [Qt-creator] Qt Creator Clazy Support

On Fri, Mar 16, 2018 at 10:48 PM, Jeff Tranter <***@ics.com<mailto:***@ics.com>> wrote:
I'm trying to get the new Clazy support in Qt Creator working.

I have Qt Creator 4.6.0 rc1 compiled from source against Qt 5.10.1 on Ubuntu Linux.

In Tools / Options, under Analyzer, it shows:

Clang executable: clang-5.0
Version: 5.0.0, supported.

Under C++ / Code Model, is says:

"The Clang Code Model is disabled because the corresponding plugin is not loaded."

Under Help / About Plugins... it shows ClangStaticAnalyzer loaded, version 4.5.83.

I also have clazy built from git and installed and it runs on its own.

I am able to run the Clang static analyzer from Qt Creator but I can't seem to run or configure clazy.

Any ideas?

You need to enable the ClangCodeModel plugin, not ClangStaticAnalyzer.

- Orgad
Loading...