clang
iwyu: fatal error: ‘stddef.h’ file not found
Include-what-you-use and Qt are not friends. iwyu-support in QtCreator is requested for a while, nobody cares.
So I installed it via apt; set an override to make and reran the build-process on a cleaned project:
1 |
`-k CXX=/usr/bin/iwyu |
Result: more than fifty errors like “fatal error: ‘stddef.h’ file not found”.
Some said that clang is missing (because that header is part of the installed package, my clang was 12 – iwyu was built against 11).
So the solution is:
1 |
sudo apt-get install libclang-common-11-dev |
cppcheck pt. II
It’s quite funny if you want to use the current version of your favorite static code analysis-tool, then realize that no OS-binary is availabe, then think “why not create it yourself like you did it with older versions?” (qmake && make ..), then realize your current clang-version does not support the missing c++11-features (cbegin/cend), then you realize you are not allowed upgrade your local compiler ..
To put it in a nutshell:
1 |
homebrew install cppcheck && cd <source to check> && cppcheck --enable=all --inconclusive --std=posix . 2> cppcheck.txt |
Yes, this leaves you without the gui, but still better than nothing.
side note: I also found the cppcheck-plugin for QtCreator-project on sourceforge (new since august 2015?), but since the contributor provides just Win and Linux binaries, but neither source nor OSX-binaries, I have to wait. But looks promising.
edit 20151005:
Only fifteen hours after my request the russian mastermind behind the project built an OSX-dylib for the cppcheck-plugin and offered it to me for testing. After update from QtCreator 3.42 to 3.5, copying the plugin, activating it and setting the path to the homebrew-1.70-cppcheck, everything works! No more switching between the cppcheck-output and QtCreator, just fix the issues! *feels good*
edit 20151006:
Now it is officially available. Enjoy!