源码编译通过,但运行时出现错误,程序直接退出。 谢谢!
我的环境是 win7 - 64bit . 错误信息如下:
Starting E:\qt_Workspace\Modules\Network\build-Http-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\Http.exe... Auto configuration failed 180:error:02001015:system library:fopen:Is a directory:.\crypto\bio\bss_file.c:126:fopen('g:/phpbuild/apps_install/openssl.cnf','rb') 180:error:2006D002:BIO routines:BIO_new_file:system lib:.\crypto\bio\bss_file.c:131: 180:error:0E078002:configuration file routines:DEF_LOAD:system lib:.\crypto\conf\conf_def.c:199: QMutex: destroying locked mutex E:\qt_Workspace\Modules\Network\build-Http-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\Http.exe exited with code 1
源码如下:
widget.h:
#ifndef WIDGET_H #define WIDGET_H #include <QtNetwork> #include "ui_form.h" class Widget :public QWidget, public Ui::Form { Q_OBJECT public: Widget(QWidget *parent =0); private slots: void replyFinished(QNetworkReply *reply); private: QNetworkAccessManager *manager; Ui::Form *ui; }; #endif // WIDGET_H
#include "widget.h" Widget::Widget(QWidget *parent) :QWidget(parent) { setupUi(this); manager = new QNetworkAccessManager(this); connect(manager,SIGNAL(finished(QNetworkReply*)), this,SLOT(replyFinished(QNetworkReply*))); manager->get(QNetworkRequest(QUrl("http://www.sina.com.cn"))); } void Widget::replyFinished(QNetworkReply *reply) { QTextCodec *codec = QTextCodec::codecForName("utf8"); QString all = codec->toUnicode(reply->readAll()); ui->textBrowser->setText(all); reply->deleteLater(); }
#include <QApplication> #include "widget.h" int main(int argc,char *argv[]) { QApplication app(argc,argv); Widget widget; widget.show(); return app.exec(); }
没有引用全还应该引用什么?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。