Reputation: 763
I got this strange problem:
I write an program using Qt(core/gui/sql/webkit), and it works just fine.
But a few days ago it suddenly broken. The executable file would EXIT right after it was started, both the DEBUG/RELEASE version have this odd issue.
This is what i've tried to figure out the reason:
I put a breakpoint right in the file main.cpp
, the line QApplication a(argc, argv)
.But it seems that the debuger even not reach that point.
I try my project on an other PC, and the problem is still there.
Any advise is appreciated.
Addition:
ENV: Win7/VS2010/Qt-4.8.4
The main.cpp:
#include "adeditor.h"
#include <QtGui/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
ADEditor w;
w.show();
return a.exec();
}
The adeditor
inherits from the class QMainWindow
.
FIXED BUT I DONNOT KNOW WHY
Here is the solution:
I create a New project and Copy all the content of each file in the original project and It just worked.
I strongly want to know how it happens so the next time it occurred to me, i would like to know how to deal with i properly .
Upvotes: 0
Views: 112
Reputation: 17131
Posting my comment as an answer so it gets a little bit of visibility for future visitors:
There's also the possibility that you have another
main
function hanging around somewhere that's being called/linked to instead. – OmnipotentEntity 34 mins agoI've checked the situation before and there did have another
main
but after i fixed this ,nothing changed. – helsinki 29 mins agoHave you performed a completely clean build from scratch since removing that
main
? – OmnipotentEntity 23 mins ago@OmnipotentEntity: YES! It's exactly the problem, now I know it, thanks – helsinki 7 mins ago
Upvotes: 1