Using MSVC with QT creator: The clangbackend process has finished unexpectedly and was restarted - qt

I'm using Qt Creator 4.7.2 and when I try to make a project using Desktop QT 5.11.2 with MSVC2015 32 bit compiler I get a repeating message under general messages:
Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.
This message is repeating 3 times every second and the text editor is very laggy as well. This only happens when I use the MSVC compiler, it works okay with MinGW. My code is just the basic window code that auto generates when you create a new project. Anyone know how to fix this?

Open Help > About Plugins.... Then, under C++, disable ClangCodeModel.

Related

Qt Creator no longer displays console output in Application Output window after Windows 10 1809 update

I'm running an application in debug with Qt 5.2.1 and Qt Creator 4.5.0. For many months this has been fine, and the console output is shown in the Application Output window. I applied the 1809 update to Windows this morning, and now I only see exception details in the output window, nothing else.
Interestingly, when I "Run in Terminal" the output is shown in the command window. It's also shown if I "Run" (ctrl-R) the application. It also seems to be OK when I run the tests for an application with a later version of the Qt framework (5.12.1, in my case).
Has anyone else experienced this? I'm not even sure where to start with fixing the problem.
EDIT: More information. I looked at the Qt 5.2.1 sources and saw that the qDefaultMessageHandler doesn't output the message if a console window is attached to the process (as you'd expect, for example if you selected the "Run in Terminal option"). If I call FreeConsole() at the beginning of my application, then the output appears as it used to in the Application Output window. This suggests that the update to Windows has caused a console window to be allocated to the debug process.
Change the settings, Edit>Preference>Built&Run>General Tab> Default for run in terminal.
choose those options as u wish.
u can individually change the settings for projects, Select Projects tab > Built & Run >Run >Run in terminal
It might be a bug in Qt 5.2, especially if it works with later Qt versions.
The right answer is: upgrade to a later version of Qt.
The reason is that Qt 5.2 support ended more than 3 years ago.
You should be using one of the currently supported version: 5.9.8, 5.12.4 or 5.13.0.
Note that 5.9 and 5.12 are LTS, but 5.9 support is due to end next year. So 5.12 seems to be the best fit if you don't want to upgrade every 6 months.
Edit
If you cannot update the production version of Qt for any reason, you can at least update Qt Creator on your system and update your development version of Qt.
Let's say you use Qt 5.9 or 5.12 on your computer when you write and test code. But keep 5.2.1 for any other part of the dev loop (testing, CI, ...) and for production.
Qt offers great compatibility across versions, if you write code that compile for 5.2, it will compile without change for any 5.x with x >= 2.
For those of you that are interested, I worked around the problem by conditionally calling FreeConsole() at the beginning of the program, like this:
#ifdef Q_OS_WIN
#include <Windows.h>
#endif
...
#ifdef Q_OS_WIN
#if QT_VERSION <= QT_VERSION_CHECK(5, 2, 1)
// Since the Windows 10 1809 update was pushed, the debug process has a
// hidden console window allocated to it. This prevents the application output
// reaching the console window in Qt 5.2.1 (see qlogging.cpp in the qt source for
// reasons why). This detaches that console window, meaning the output is shown in the
// application output window again. However, if "Run in terminal" is selected in the
// Run options then the output will still be shown in the Application Output window.
FreeConsole();
#endif
#endif
The solution is pretty simple:
Add
CONFIG += console
To your .pro file

Qt Creator crashes loading Examples

There is an Example tab at the Qt Creator(2.6.1)'s Welcome page, which is supposed to show the already made Qt Project Examples. But whenever I click on that, Qt creator closes automatically. Sometimes it shows the Example projects for 1 or 2 seconds and the exits. Any idea?
You probably need to configure Qt Creator to find your Qt installation.
Compiler configuration for Qt Creator
And you might need to get the msvs compiler, too.
http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products
They now have the mingw version available for windows with Qt 5.0.2.
http://qt-project.org/downloads
Also if you installed Qt without the examples that may also cause this error.
Hope that helps.

Which c++ compiler to use qt5 win7

trying to create a GUI for the first time.
I've decided to try QT 5.0, but it keeps giving me the error:
error: Qt Creator needs a compiler set up to build. Configure a
compiler in the kit options.
I go into kit options, and I can choose a number of different Visual Studio 11 compilers, or a MinGW compiler.
I have tried pointing the MinGW compiler to several different .exe files in the minGW bin dir, like c++.exe, gcc.exe, g++.exe, etc. I still receive the error message.
Then I read somewhere that I need to use MSVC10 to compile, however I can not find this compiler anywhere.
I just need to create a simple window with a couple labels and text boxes and a button, and I can't even get as far as creating a window.
Thanks for any help
I had to install MSVC2010, and use that compiler.
First configure a compiler in the "Compilers" tab of the "Build & Run" section in the Creator options. Then you can chose a configured compiler in a kit. Then set your project to use that kit.

can’t debug in qt sdk 1.2-during startup program exited with code 0x0

Today I found that I could not debug in pure C projetc, but I could debug in qt gui project.
The error was “ during startup program exited with code 0×0”.
I was using Win 7 ultimate 64bit sp1. I had tried in another computer, it was the same.
My program ran when I was not trying to debug it.
Could someone help?
Qt SDK 1.2 includes qt lib 4.8 and qt creator 2.4.1.
Uncheck run in terminal, in Projects -> Run Options
If the debugger does not work properly, try the following:
Make sure you use at least Qt Creator 2.1.
Make sure the debugger is set up properly. For more information, see Setting Up Debugger.
In the Debug mode, select Windows > Views > Debugger Log to open the Debugger Log view. Browse the contents of the pane on the right hand side to find out what went wrong. Always attach the contents of the pane to debugger-related questions to the Qt Creator mailing list (qt-creator#trolltech.com) or paste them to creator.pastebin.com before asking questions in the IRC (on the #qt-creator channel at FreeNode).

Qt notification example error

I am working on Qt application on Ubuntu 10.04 with 'Qt Creator' and trying to run the example application given in the toolkit,
It is giving me an error, when i run the application.
notificationexample.cpp:34: error: ovinotificationinterface.h: No such file or directory
Please help
ovinotificationinterface.h is part of the mobile/embedded code rather than the desktop pcakage, how did you get Qt Creator installed? Or if you want to use the mobile stuff double check it's been installed.

Resources