Cannot #include <QWebView> using QtCreator
-
have read a lot trying to figure this out. I am using QtCreator on Ubuntu 13.10.
.pro:
#-------------------------------------------------
Project created by QtCreator 2014-03-02T09:50:03
#-------------------------------------------------
QT += core gui
QT += webkit
QT += webkit webkitwidgetsgreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = AndroidDecompiler
TEMPLATE = appSOURCES += main.cpp
mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui
MAIN
#include "mainwindow.h"
#include <QApplication>
#include <QtWebKit>
#include <QWebView>int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();QWebView view; view.show(); view.setUrl(QUrl("http://google.com")); return a.exec();
}
Here is error ':-1: error: cannot find -lsqlite3'
I think it is due to not being able to include webview. Is their any suggestions?
-
[quote author="horvste" date="1394239720"]
Here is error ':-1: error: cannot find -lsqlite3'
[/quote]First of all please use @ to wrap your code when you are posting anything to the forum because it will be easier for reading.
This error is not related to QWebView. The SQLite library cannot be found. Try to install package libsqlite3-dev with contains "SQLite 3 development files":https://apps.ubuntu.com/cat/applications/libsqlite3-dev/ on your Ubuntu.
-
Everytime I use Qwebview ,then it comes to the problem:
what should I do?lQt5WebKitWidgets -lX11 -lxslt -lgio-2.0 -lgstapp-0.10 -lgstinterfaces-0.10 -lgstpbutils-0.10 -pthread -lgstvideo-0.10 -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lxml2 -lgthread-2.0 -lrt -lglib-2.0 -lQt5Sql -lQt5Quick -lQt5OpenGL -lQt5PrintSupport -lQt5Qml -lQt5WebKit -lQt5Widgets -lQt5Positioning -lQt5Sensors -lQt5Network -lQt5Gui -lQt5Core -lGL -lpthread
make: Leaving directory `/home/lanyue/qtcpp/build-01-Desktop_Qt_5_2_1_GCC_64bit-Debug'
/usr/bin/ld: cannot find -lxslt
/usr/bin/ld: cannot find -lgio-2.0
/usr/bin/ld: cannot find -lgstapp-0.10
/usr/bin/ld: cannot find -lgstinterfaces-0.10
[quote author="leon.anavi" date="1394243253"]
[quote author="horvste" date="1394239720"]
Here is error ':-1: error: cannot find -lsqlite3'
[/quote]First of all please use @ to wrap your code when you are posting anything to the forum because it will be easier for reading.
This error is not related to QWebView. The SQLite library cannot be found. Try to install package libsqlite3-dev with contains "SQLite 3 development files":https://apps.ubuntu.com/cat/applications/libsqlite3-dev/ on your Ubuntu.
[/quote] -
Hi,
It means you are missing at least gstreamer (if already installed, then the related dev packages)
-
Try this code
@QT += core gui
QT += core gui webkit
QT += webkitwidgets@to replace first three lines..