我无法让webengine工作。这是我的源代码:
#include <QtWidgets/QApplication>
#include <QtWebEngineWidgets/QWebEngineView>
int main(int argc, char ** argv) {
QApplication app(argc, argv);
QWebEngineView view;
view.setUrl(QUrl(QStringLiteral("http://www.qt.io")));
view.resize(1024, 750);
view.show();
return app.exec();
}
当我尝试运行它时会发生这种情况:
$ g++ test.cpp -I/usr/include/qt -fPIC -lQt5Core -lQt5Gui -lQt5Widgets -lQt5WebEngine -lQt5WebEngineWidgets && ./a.out
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Unrecognized OpenGL version
Unrecognized OpenGL version
没有显示任何窗口,它只是挂在那里直到我用^C
杀死它。我怎样才能让它发挥作用?