uzay95
uzay95

Reputation: 16622

ld returned 1 exit status

This is the code that i'm trying to run:

#include <QApplication>
#include <QPushButton>

int main(int argc,char *argv[])
{
    QApplication app(argc,argv);

    return app.exec();
}

And this is the error that i'm getting:

:-1: error: collect2: ld returned 1 exit status

Id returned 1 exit status

alt text

Upvotes: 1

Views: 5264

Answers (3)

Ashesh Ambasta
Ashesh Ambasta

Reputation: 9

This can also happen if you're running out of disc space.

Upvotes: 1

Frank Bollack
Frank Bollack

Reputation: 25166

If you read the error message carefully, you will see the problem.

...ld.exe: cannot open output file ...

The linker is trying to write the generated executable file (debug.exe) to disk, but is not allowed to (Permission denied). This is mostly due to the fact that the application you built is currently running.

Close it and rebuild the application.

Upvotes: 7

avakar
avakar

Reputation: 32635

You have to close the application before rebuilding it.

Upvotes: 2

Related Questions