ld returned 1 exit status

谁说胖子不能爱 提交于 2019-12-08 08:34:48

问题


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


回答1:


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.




回答2:


You have to close the application before rebuilding it.




回答3:


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



来源:https://stackoverflow.com/questions/3005975/ld-returned-1-exit-status

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!