Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED] Problem Building With QWebView



  • I am trying to use QWebView for the first time.

    Ubuntu 12.04
    Qt 5.2.1

    In pro file I have added:

    @
    QT += core gui webkit webkitwidgets
    @

    mainwindow.cpp

    @
    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    #include <QtWebKitWidgets>
    #include <QWebView>

    MainWindow::MainWindow(QWidget parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    QWebView
    view = new QWebView;
    view->setUrl(QUrl("http://localhost"));
    view->show();

    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }
    @

    These are the compile errors, I have ran qmake, clean all etc,

    @
    error: cannot find -lxslt
    error: cannot find -lgio-2.0
    error: cannot find -lgstapp-0.10
    error: cannot find -lgstinterfaces-0.10
    error: cannot find -lgstpbutils-0.10
    error: cannot find -lgstvideo-0.10
    error: cannot find -lgstbase-0.10
    error: cannot find -lgstreamer-0.10
    error: cannot find -lgobject-2.0
    error: cannot find -lgmodule-2.0
    error: cannot find -lxml2
    error: cannot find -lgthread-2.0
    error: cannot find -lglib-2.0
    error: collect2: error: ld returned 1 exit status
    @

    Any idea?


  • Lifetime Qt Champion

    Hi,

    Nothing specific to QWebView here, you are missing all the libraries listed there on your system in order to build your application with Qt.

    Start by installing the gstreamer related packages.



  • [quote author="SGaist" date="1395144422"]Hi,

    Nothing specific to QWebView here, you are missing all the libraries listed there on your system in order to build your application with Qt.

    Start by installing the gstreamer related packages. [/quote]

    That's odd, all of my other projects compile fine. OK, will start with gstreamer.


  • Lifetime Qt Champion

    Because you didn't used the multimedia stuff yet ;)

    These dependencies won't show until you need them (or a module you use needs them)



  • Sorted.

    Used

    @
    sudo apt-get install libgstreamer-plugins-base0.10-dev
    @

    and its all working now.

    Thanks again.


Log in to reply