In QT Creator build issues are showed in window as readable, filterable, customizable list.
Example of build issues in Qt Creator:
But in CLion it just a text list with links to build issues.
Example of build issues in CLion:
How to view build issues in CLion more readable?
I think that the main reason is that Qt Creator uses the clang toolkit to gather semantic information about the code, while CLion has its own C++ parser. As such, CLion has a direct representation of the compiler errors and warnings, as you mention.
On the other hand, CLion is able to notify you of errors and warnings without compiling the code, immediately :-) This feature is called "Code inspection", is customizable and filterable, and will give you even more information than the compiler.
You can find it under Code | Inspect code....
Example output:
See also my other answer to a similar question.
Related
I have used Visual Studio successfully to generate class diagrams from C++ source code.
But I'm finding it hard to do the same in CLION. I used Settings / Preferences | Tools | Diagrams as per the JetBrains documentation, but it throws this error CLION diagrams error. "The current file or folder does not have any dependencies. Please try with another file or folder". But my source code is indeed having many dependencies.
How to generate class diagrams (UML or non UML) from C++ source in CLION?
I'm not familiar with CLion, but from what I've googled, it seems that CLion does not support C++ class diagrams: see this support question about UML Diagrams in CLion and the corresponding feature request OC-1038 filed ten years ago, still not implemented.
However, CLion seems to have a basic UI allowing you to browse class hierarchy by pressing Ctrl+H, as shown in this CLion: A Modern C++ IDE video by Dmitri Nesteruk from JetBrains at 41:43.
I just installed QtCreator 4.7.2, which comes with ClangCodeModel plugin by default on. After my CMake project was parsed I saw much better highlighting of keywords in the code and also awesome intellisense handling of auto declared variables.
The downside was that the ClangCodeModel plugin was buggy, and gave me errors and warnings in parts of code that didn't make sense, especially the ones in 3rd party library header files. So I was forced to turn it off.
I'm wondering if Clang can be configured in QtCreator, so that minimal checks can happen. I played with these settings, but nothing made a difference:
1) Has anyone been able to configure this plugin in QtCreator so that it can work better? I am mostly concerned about intellisense. I can open the same CMake project in Visual Studio and I have much better intellisense there, but I prefer using Qt Creator.
2) If #1 is not possible because the plugin has bugs, what are the other means of improving intellisense in Qt Creator with CMake projects?
The screenshot you took is from the "Analyzer" settings.
The Analyzer performs on-demand checks like running static analysis, clang-tidy, callgrind, etc.
To configure the Code Model, you should go to "C++ > Code Model":
You also have the possibility to override this settings on a per-project basis:
In both cases you can, by clicking on Manage..., create your own configuration with whatever flags you want:
I'm a newbie in both LLVM developing and cpp.
I wanted to ask if there was a way to develop a pass for LLVM in Xcode having all the typical features available in an IDE like autocomplete and syntax code highlighting.
Right now I am just writing c++ code, checking everything I need on the documentation, but, as you can imagine, this is really slowing me down and it's really error prone...
Don't know if this can help, but my LLVM folder is structured this way:
"llvm_3.8_source/" root folder of llvm3.8 source files
"llvm_3.8_source/build" root folder of my llvm3.8 build
Thanks
Yes, it is possible.
LLVM uses CMake as a build-system generator. CMake supports such things as old good makefiles, ninja, xcode, and visual studio.
You can simply create Xcode-project using the following commands from terminal:
cd llvm_build
cmake -G Xcode path/to/llvm/sources
open LLVM.xcodeproj
First you will see lots of errors and 'red' marks. It's because some parts of LLVM sources are generated during compilation.
All files will be generated as soon as you attempt to build project first time and all the 'red' marks will gone.
You can read this article to get a bit more info on the topic:
Getting started with LLVM/Clang on OS X
My problem is that I get fake warning icons but there is no message of a warning.Why fake? Because when I did an obvious mistake which should show warning, I could find the message in the issues.
These fakes warnings do not show any messages they are just standing there.
When I compiled my code on various IDE s no message was shown that why I am completely sure that is not a fault of code.
IDE:
Qt Creator 3.6.1
OS :
Arch Linux..
Edit: They show messages but only when I move my cursor to a particular one. The question is how can I move them to be shown in issues?
Looks like you have the clang code model enabled - it is a huge nag, complains just about anything.
In Creator go to Tools -> Options -> C++ -> Code Model, then uncheck Use Clang Code Model.
Disabling it will also improve the performance of Creator, but in case you chose to keep it enabled and still want all those warnings to go away, you have no other choice but to fix your code so it is up to the clang code model.
The warnings aren't fake, it is just the the clang code model, as current configured in your IDE is at maximum strictness, it will complain about a lot of things which are practically harmless, just because theoretically they are not considered "best/proper practice".
Note that you can also configure the code model by adding or removing individual flags, in Creator 4 there will also be different presets for it.
Yesterday I had done a lot of things like updating GCC, Clang and reinstalling Qt Creator.Today when debugging my code step by step, the debugger was showing the disassembley rather than the C++ code I wrote. Pressing F10 or F11, the debugger was moving into assembly code not the .cpp nor .h files I wrote. F11 can only go into the library files but never into the files I wrote.
The arrow appeared in disassembler:
Rather than in main.cpp:
How can I configure Qt Creator such that the debugging arrow tracks each line in the C++ code?
For others who also had this problem but none of the solutions above worked (like me), I found out that the issue for me was simply happening because my project was inside of a directory with special characters (/home/fabio/criação/project) the criação folder seems to have caused the problem. After I changed to /home/fabio/Desktop/project it stop happening.
I ran into a very similar problem debugging code built with the clang toolset in qtcreator, and this answer fixed me up:
gdb doesn't find source files compiled by clang++
You can quickly check if that solution will work for you by navigating to the root of your solution in a shell window and then invoking qtcreator from there...set a break point in main() and try debugging - if it stops and shows source in main.cpp, it's quite likely this is the problem.
If that does work for you, there are probably several better ways to implement the permanent solution suggested by https://stackoverflow.com/users/1632219/rene, but the method that worked for me was to modify my qmake mkspec file for the clang toolset. On my system, it lives in /usr/local/Trolltech/Qt-4.8.5/mkspecs/common/clang.conf, so all I had to do was put a clang invoker script with 'clang++ "$#"' in ~/bin/clang-compile and then set QMAKE_CXX in the mkspec to clang-compile. With that change, when the clang toolset is selected, qmake builds make files that use clang-compile instead of clang++ and then debugging works everywhere.
At last, I found that it was Clang that had caused this problem. After changed the kit back to using gcc, it just worked fine. But not sure whether it's Clang's fault or that the script Qt produced for compiling has any problem. Anyway just put the answer here in case anyone else who might encounter the same situation.
Goto "Help->About Plugins" and check the "ClangCodeModel" and restart QT.
There is a bug in version Qt 5.6.1 (MSVC 2013, 32 bit) QT Creator4.0.3.
In debug mode put your breakpoint. Then hit the step into(F11) it will start debugging now. To go to your code hit the step-over(F10) until you come to the code page.
I have searched about this problem but nothing worked. Some solution, i didn't get.
This is very annoying issue.
Maybe it will work if you clean, qmake and rebuild.I solved this problem by using this method.