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

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).

Related

Cannot step into Qt source

I create a Qt project,build the project with msvc2017-32bit kit, and debug the project in Qt Creator. The problem is I can not step into the Qt functions. I can stop at break-points in my own source code, but cannot stop at break-points in files in Qt src directory. When I step into a Qt function, a message Stopped: "end-stepping-range" appears by the debugging buttons. Why could this happen?
According to #user13088490's suggestion, I installed the debugger tools for windows in windows 10 SDK, but the problem persists.
Follow the instructions from Qt here.
For Mac, the instructions are:
In Projects->Build&Run->Run->Run Settings->Run, select "Use debug version of frameworks".
There are different instructions for Windows, but I have not tried it yet.
You probably also need to have QT sources installed.
Go to the MaintenanceTool and check if Qt Creator 4.15.2 CDB Debugger Support and Debugging Tools for Windows has been selected.
I run Qt on Windows, although a different compiler than you, and you can set the debug target paths by going to Tools->Options->Debugger. From here you can click a button Add Qt sources.... Below is an image of my setup and this works for me.

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

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.

How to permanently disable QML debugger in Qt?

Whenever I make a Qt project, the qmake command includes this parameter:
"CONFIG+=qml_debug"
I never use qml and dont want to manually click three times and ignore the warning every time I generate a new project.
It happened to me in a project. I just added this to the .pro file :
CONFIG -= qml_debug
It seems to work.
You can download Microsoft Visual Studio 2017 Community Edition, it's free to use. And it is not only a great IDE but also it has got Qt support. By downloading Qt plug in for Microsoft Visuals Studio you can create Qt projects and build and debug them...
Everything that you do with Qt Creator and it has got no such problem as yours.
Also if you want to stay with Qt creator, check Projects -> Build & Run -> Run Settings. There is Enable QML setting which mine is disabled. Maybe you can disable it from there.
If not I advice you to check Tools -> Options -> Build & Run and Tools -> Options -> Debuggers. If it can be solved within Qt Creator it must be solved from these places.

Run qt qml app on another pc

I wrote some app in Qt 5.7.1 with Qml Quick 2.6.
It does not run on another pc where Qt does not install.
In logs I see this error:
"[WRN] QQmlComponent: Component is not ready".
In Windows's Task Manager I see app is running, but there is no window of app.
All qml files I put in resourse file.
new QQmlComponent(&(this->engine),
QUrl(QStringLiteral("qrc:/qml/design/qml/main.qml")));
Dirs with app looks:
When I start app on another PC, there are no any message with errors about depence of some dlls. Please help...
Getting the correct (and minimal) set of DLL binaries copied over to the target machine isn't the easiest thing. But there's standard documentation for it and a helper tool called windeployqt that you should check out.
http://doc.qt.io/qt-5/windows-deployment.html

No application output in QtCreator debug

With QtCreator 2.8 under Win7 with CDB debugger, I cannot see in the
Application Output tab all my fprintf(stdout) stuff !?
I tried:
fprintf(stderr, "...");
fprintf(stdout, "..."); fflush(stdout);
Nothing happens.
In the meantime, If I check the "Run in terminal" option, it works !?
Although I noticed that all the output go to debugger log !?
Any idea ?
As a workaround you can enable the output in CDB console: tools/options/debugger/cdb then check "Use CDB console".
To show the debugger, right click on some window header and select "Debugger Log".
You may also right click on the debugger log view to disable the verbose log.
Btw, I also noticed that the standard application output window works well when you "attach to the running process" instead of starting it from qtcreator.
Not an answer, just a comment that this is obviously a "feature" and isn't going
to get fixed.
I've just started porting a C++/Qt project that has been developed under linux with GCC and Clang, and Windows 7 with MinGW GCC, to Windows 10 with MSVC. If my test code is run as individual programs it reports "All tests passed" (or not), to the console, (std::cout) which in this case is the Qt Creator Application Output window. It has been working on all systems, with all compilers, in both debug and release mode, for years. It now doesn't write to the Application output window when run via the debugger, only if run as if it was the release version.
On discovering this (2021-04-16), I Googled for the solution, and landed here.
I know that this answer do not answer the original question, but since when searching for "No application output" we found this answer...
See the following answer: https://stackoverflow.com/a/26325743/808101.
This only apply to qDebug() and similar functions (not direct output to stdout/stderr).
In my case, I have to set QT_ASSUME_STDERR_HAS_CONSOLE environment variable to 1 in QtCreator in order to see qDebug() messages inside "Application Output" window. For older version of Qt see linked answer for old/deprecated environment variable.
I often use qDebug this way.
#include <QDebug> in the top of the file
Usage:
qDebug() << "This is a Test";
It runs well when using QT creator and does not matter in GUI programming or Console Application.

Resources