Search code examples
c++qtubuntuqtwebkitqwebview

QWebView on Ubuntu


file pro:

QT       += core gui network webkit webkitwidgets

file widget.cpp:

#include <QtWebKitWidgets/QWebView>

QWebView * page_View = new QWebView(this);
page_View->resize(800,600);
page_View->load(QUrl("http://vk.com"));
page_View->show();

Errors:

:-1: error: cannot find -lxslt

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


Solution

  • You will need to install the xslt library:

     sudo apt-get install libxslt1-dev libxslt1.1
    

    If you still get further errors, you will probably miss out other dependencies, too, so you may need to install the webkit development package, too:

    sudo apt-get install libqt5webkit5-dev
    

    Provided that you are running a modern enough Ubuntu having this package available.

    On a side note, you do not need add core and gui to the QT variable since they are added by default.