Using QWebkit for windows with mingw
-
What I use
Qt 5.12.8
mingw compilers both(64 and 34)
Windows 10 x64I have tried the methods given in this link ( precompiled binaries method)
https://forum.qt.io/topic/119469/webkit-for-mingw-how-to-buildI tried all of the things with almost all of binaries.
- Placing all files to QT directory
- Building with both debug and release for both 32 and 64 bit.
They give me some errors with change in KIT
32 bit release
main.cpp:-1: error: undefined reference to `_imp___ZN8QWebViewC1EP7QWidget' main.cpp:-1: error: undefined reference to `_imp___ZN8QWebView4loadERK4QUrl' main.cpp:-1: error: undefined reference to `_imp___ZN8QWebViewD1Ev' main.cpp:-1: error: undefined reference to `_imp___ZN8QWebViewD1Ev' :-1: error: collect2.exe: error: ld returned 1 exit status :-1: error: [Makefile.Release:69: release/web.exe] Error 1
32bit debug
:-1: error: No rule to make target 'C:/Qt/Qt5.12.8/5.12.8/mingw73_32/lib/libQt5WebKitWidgetsd.a', needed by 'debug/web.exe'. Stop.
64bit release
Builds successfully but exits with this in Application output panel
The program has unexpectedly finished. The process was ended forcefully.
64bit debug
:-1: error: No rule to make target 'C:/Qt/Qt5.12.8/5.12.8/mingw73_64/lib/libQt5WebKitWidgetsd.a', needed by 'debug/web.exe'. Stop.
It didn't work so :::::
I couldn't clone their repo to build it. It takes too long time and gets failed.This isn't related with above question
-
@Thank-You said in Using QWebkit for windows with mingw:
Qt5WebKitWidgets.dll is looking for
QtPrivate::argToQString(QStringView)
, which is present in recent versions of Qt Core.It sounds like the latest Qt WebKit binaries are built against Qt 5.14:
- https://forum.qt.io/post/689916
- https://github.com/qtwebkit/qtwebkit/releases/tag/qtwebkit-5.212.0-alpha4
Can you update to Qt 5.14 or Qt 5.15?
-
@Thank-You See if you can use one of the pre-built snapshots of the community version of Qt WebKit: https://download.qt.io/snapshots/ci/qtwebkit/5.212/latest/qtwebkit/
-
@artwaw
Yes sir, I did that. Above mentioned errors are produced by using precompiled binariesThat method din't work so I was thinking of building but couldn't clone the repo.
Are there other options with QT with mingw and windows. I don't need any support for linux
-
How did you install those precompiled binaries?
I just copied all files and moved to
C:/Qt/Qt5.12.8/5.12.8/mingw73_32/
for 32 bit and on 64 bitC:/Qt/Qt5.12.8/5.12.8/mingw73_32/
web.pro
QT += core gui webkitwidgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp \ mainwindow.cpp HEADERS += \ mainwindow.h FORMS += \ mainwindow.ui
mainwindow.h
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include<QWebView> #include<QtWebKit/QtWebKit> #include<QtWebChannel/QWebChannel> #include<QVBoxLayout> QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); private: Ui::MainWindow *ui; QWebView *view ; QVBoxLayout *layout; QWidget *wid; }; #endif // MAINWINDOW_H
mainwindow.cpp
#include "mainwindow.h" #include "ui_mainwindow.h" #include<QHBoxLayout> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); wid = new QWidget(); layout = new QVBoxLayout(wid); view = new QWebView(this); view->load(QUrl("https://google.com")); layout->addWidget(view); wid->setLayout(layout); setCentralWidget(wid); } MainWindow::~MainWindow() { delete ui; }
I hope it's correct 😂😂😂
-
@Thank-You said in Using QWebkit for windows with mingw:
I just copied all files and moved to C:/Qt/Qt5.12.8/5.12.8/mingw73_32/ for 32 bit and on 64 bit C:/Qt/Qt5.12.8/5.12.8/mingw73_32/
what
-
@Thank-You also if I am not mistaken you need not only
webkitwidgets
- I have a program that uses webkit as w page viewer, written some time ago, but its pro file had to haveQt += webkitwidgets webkit
together to work properly. I am not certain if this might be the case but please try, as I said it was some time ago. -
@artwaw said in Using QWebkit for windows with mingw:
you need not only webkitwidgets
Sorry, I was trying to tweak things if it will work after you asked about .pro file. I had actually have both
what
What Should I do?
Isn't it correct.
https://forum.qt.io/topic/119469/webkit-for-mingw-how-to-build/18 -
@artwaw
Single option is given:
qtwebkit-Windows-Windows_10-Mingw73-Windows-Windows_10-X86_64.7zSo I copied same things to both directories.
This is bin folder. It doesn't have any differencesand others are also same. Files aren't seperated
-
@Thank-You said in Using QWebkit for windows with mingw:
X86_64.7z
Those are 64bit binaries. They will not work if you compile for 32bit target.
-
@Thank-You said in Using QWebkit for windows with mingw:
Where can I get 32bit binaries?
On the same link from above I would guess.
-
@Thank-You said in Using QWebkit for windows with mingw:
But compiling with 64 bit also gives error on both debug and release.(Mentioned at the main post)
Hardly a surprise if you did not copy the 64bit binaries to the 64bit part of Qt tree.
-
@Thank-You said in Using QWebkit for windows with mingw:
Qt5WebKitWidgets.dll is looking for
QtPrivate::argToQString(QStringView)
, which is present in recent versions of Qt Core.It sounds like the latest Qt WebKit binaries are built against Qt 5.14:
- https://forum.qt.io/post/689916
- https://github.com/qtwebkit/qtwebkit/releases/tag/qtwebkit-5.212.0-alpha4
Can you update to Qt 5.14 or Qt 5.15?