firemail

标题: Qt 5.5.1下使用QWebView [打印本页]

作者: Qter    时间: 2018-4-17 11:54
标题: Qt 5.5.1下使用QWebView
http://doc.qt.io/archives/qt-5.5/qwebview.html

Header:
#include <QWebView>
qmake:
QT += webkitwidgets
Since:
Qt 4.4
Inherits:
QWidget
  1.    QWebView *view = new QWebView(parent);
  2.     view->load(QUrl("http://qt.nokia.com/"));
  3.     view->show();
复制代码

作者: Qter    时间: 2018-4-17 14:46
本帖最后由 Qter 于 2018-4-17 17:56 编辑

linux报如下错误:
  1. /usr/bin/ld: warning: libsqlite3.so.0, needed by /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKitWidgets.so, not found (try using -rpath or -rpath-link)
  2. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_column_int64'
  3. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_bind_double'
  4. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_data_count'
  5. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_bind_text16'
  6. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_get_autocommit'
  7. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_bind_blob'
  8. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_busy_timeout'
  9. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_prepare16_v2'
  10. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_step'
  11. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_reset'
  12. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_column_bytes'
  13. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_expired'
  14. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_column_blob'
  15. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_last_insert_rowid'
  16. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_total_changes'
  17. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_extended_result_codes'
  18. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_column_int'
  19. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_interrupt'
  20. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_value_text16'
  21. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_bind_parameter_count'
  22. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_finalize'
  23. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_column_name16'
  24. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_bind_int64'
  25. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_value_type'
  26. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_column_bytes16'
  27. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_column_value'
  28. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_set_authorizer'
  29. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_value_double'
  30. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_open16'
  31. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_errcode'
  32. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_column_decltype16'
  33. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_close'
  34. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_column_text16'
  35. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_errmsg'
  36. /home/hechengjin/Qt5.5.1_x86/5.5/gcc/lib/libQt5WebKit.so: undefined reference to `sqlite3_bind_null'
  37. collect2: error: ld returned 1 exit status
复制代码
安装一下sqlite sqlite3
  1. sudo apt-get install sqlite sqlite3

  2. $ sqlite -version
  3. 2.8.17


  4. $ sqlite3 -version
  5. 3.16.2 2017-01-06 16:32:41 a65a62893ca8319e89e48b8a38cf8a59c69a8209


  6. $ whereis sqlite
  7. sqlite: /usr/bin/sqlite /usr/share/man/man1/sqlite.1.gz
  8. $ whereis sqlite3
  9. sqlite3: /usr/bin/sqlite3 /usr/share/man/man1/sqlite3.1.gz
复制代码
重新编译,问题依旧。

安装 libsqlite3-dev
sudo apt-get install libsqlite3-dev

问题依旧。


作者: Qter    时间: 2018-4-17 18:10
本帖最后由 Qter 于 2018-4-17 18:17 编辑

本地查看安装情况
locate libsqlite3.so
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
发现默认是安装的64位的,要安装下32位的


用下列命令查找32位包

aptitude search libsqlite3

安装

sudo apt-get install libsqlite3-dev:i386

编译成功。





欢迎光临 firemail (http://firemail.wang:8088/) Powered by Discuz! X3