helsinki
helsinki

Reputation: 763

Program exit with exit state 0 right after it's started

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:

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

Answers (1)

OmnipotentEntity
OmnipotentEntity

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 ago

I've checked the situation before and there did have another main but after i fixed this ,nothing changed. – helsinki 29 mins ago

Have 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

Related Questions