Qt Creator 的 error: collect2: ld returned 1 exit status 问题
2010-04-05 12:53
459 查看
用Qt Creator写程序,编译的时候有时会出现这个错误
error: collect2: ld returned 1 exit status
这个是因为程序中出现了 dd -> show();之类的让界面一闪而过的代码
比如
#include<QtGui>
int main(int argc,char *argv[])
{
QApplication app(argc,argv);
QDialog* dd = new QDialog();
dd -> show();
return app.exec();
}
解决办法是 可以在进程中关闭,或者在代码的最后加 return 0;
#include<QtGui>
int main(int argc,char *argv[])
{
QApplication app(argc,argv);
QDialog* dd = new QDialog();
dd -> show();
return app.exec();
return 0;
}
这样程序就正常了
这样这个mian函数才是标准的C语言格式,就能解决这个问题了,以前从来不明白return 0 或者exit()之类的东西有什么用,现在终于明白了
error: collect2: ld returned 1 exit status
这个是因为程序中出现了 dd -> show();之类的让界面一闪而过的代码
比如
#include<QtGui>
int main(int argc,char *argv[])
{
QApplication app(argc,argv);
QDialog* dd = new QDialog();
dd -> show();
return app.exec();
}
解决办法是 可以在进程中关闭,或者在代码的最后加 return 0;
#include<QtGui>
int main(int argc,char *argv[])
{
QApplication app(argc,argv);
QDialog* dd = new QDialog();
dd -> show();
return app.exec();
return 0;
}
这样程序就正常了
这样这个mian函数才是标准的C语言格式,就能解决这个问题了,以前从来不明白return 0 或者exit()之类的东西有什么用,现在终于明白了
相关文章推荐
- Qt Creator 的 error: collect2: ld returned 1 exit status 问题
- Qt Creator 的 error: collect2: ld returned 1 exit status 问题
- Qt Creator 的 error: collect2: ld returned 1 exit status 问题
- Qt中的:error: collect2: ld returned 1 exit status 错误问题
- linux下Qt问题cannot find -lGL collect2: error: ld returned 1 exit status
- Qt Creator报错 error: collect2: ld returned 1 exit status
- QT4 编译错误 error: collect2: ld returned 1 exit status
- 关于collect2: error: ld returned 1 exit status 问题的解决方法
- collect2: ld returned 1 exit status问题
- “collect2: error: ld returned 1 exit status”问题解决!
- QT4 编译错误 error: collect2: ld returned 1 exit status
- Linux gcc编译提示:undefined reference to `sqrtf' collect2: error: ld returned 1 exit status
- /usr/bin/ld: cannot find -lGL collect2: error: ld returned 1 exit status
- cocos2dx向android平台移植出现问题undefined reference to 'sqlite3_close' collect2: ld returned 1 exit status
- error: collect2: ld returned 1 exit status
- error:collect2:ld returned 1 exit status
- collect2: error: ld returned 1 exit status
- error: collect2: ld returned 1 exit status