I am building the Qt opensource on Ubuntu Linux. The target platform is the BeagleBone Black. Build process itself runs successfully, but I do not find the libQt5Webkit.so in the /lib/ directory.
Build and target platform details:
Host: Ubuntu Linux 15.04 x64
Target Hardware: BeagleBone Black
Target OS: Angstrom Linux
Toolchain: arm-linux-gnueabi
Qt Version: 5.4.2
Build Command: ./configure -v -opensource -confirm-license -prefix
/home/developer/projects/dependencies/qt/qt-5.4.2_Angstrom_BBB
-device linux-beagleboard_angstrom-g++
I am not disabling any modules as evident from the ./configure command options.
I have the following questions:
Is the building of the QtWebKit module disabled / removed?
How do I enable building the QtWebKit module project?
How can I cross-compile only the QtWebKit project?
If more information is required, I will provide.
Thanks.
Related
I have cross-compiled QT static for Raspberry PI using
./configure -opengl es2 -opensource -confirm-license -release -static \
-prefix /usr/local/qt5static -hostprefix ~/raspi/qt5 -extprefix ~/raspi/qt5static \
-device linux-rasp-pi-novc-g++ \
-device-option CROSS_COMPILE=arm-raspbian-linux-gnueabihf- \
-optimized-qmake -reduce-exports \
-sysroot ~/raspi/sysroot \
-make libs -make tools -no-use-gold-linker -v
where the 'novc' device is essentially the same as linux-rasp-pi-g++ but with no includes or libs from /opt/vc. When I run the program, it starts in full screen (because of eglfs), and when probed with export QT_DEBUG_PLUGINS=1 yields*
QFactoryLoader::QFactoryLoader() ignoring
"org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3" since
plugins are disabled in static builds qt.qpa.plugin: Could not find
the Qt platform plugin "android" in "" This application failed to
start because no Qt platform plugin could be initialized. Reinstalling
the application may fix this problem.
Available platform plugins are: eglfs, eglfs.
It is fine that the factory loader fails, but why is there only eglfs, and where are there two of them? How can I make sure xcb is an option and that it is the default option?
*I use myapp -platform android since I know that Android is not in there. The dynamically linked QT from sudo apt install qt shows
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl,
offscreen, xcb.
I would like that from my static compile. Here are my QPA backends (I do see eglfs for X11, and maybe that is what I have to trigger...)
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ no
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGL on X11 ........................... yes
LinuxFB ................................ yes
VNC .................................... yes
Mir client ............................. no
X11:
Using system-provided XCB libraries .. no
EGL on X11 ........................... yes
Xinput2 .............................. no
XCB XKB .............................. yes
XLib ................................. yes
XCB render ........................... yes
XCB GLX .............................. yes
XCB Xlib ............................. yes
Using system-provided xkbcommon ...... no
Native painting (experimental) ....... no
My hello_plugin_import has this:
// This file is autogenerated by qmake. It imports static plugin classes for
// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables.
#include <QtPlugin>
Q_IMPORT_PLUGIN(QEglFSIntegrationPlugin)
Q_IMPORT_PLUGIN(QXcbEglIntegrationPlugin)
Q_IMPORT_PLUGIN(QXcbGlxIntegrationPlugin)
Q_IMPORT_PLUGIN(QGifPlugin)
Q_IMPORT_PLUGIN(QICNSPlugin)
Q_IMPORT_PLUGIN(QICOPlugin)
Q_IMPORT_PLUGIN(QJpegPlugin)
Q_IMPORT_PLUGIN(QTgaPlugin)
Q_IMPORT_PLUGIN(QTiffPlugin)
Q_IMPORT_PLUGIN(QWbmpPlugin)
Q_IMPORT_PLUGIN(QWebpPlugin)
Q_IMPORT_PLUGIN(QEglFSEmulatorIntegrationPlugin)
Q_IMPORT_PLUGIN(QEglFSKmsEglDeviceIntegrationPlugin)
Q_IMPORT_PLUGIN(QEglFSX11IntegrationPlugin)
Q_IMPORT_PLUGIN(QConnmanEnginePlugin)
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)
Update. I noticed that I can install a bunch of libxcb packages into my sysroot. I think if I do this, I can get xcb to show up as platform option (or even default platform option??). But does this mess up my static compile? Will my customer also need to have all these libraries installed or will qmake do the right thing?
libglu1-mesa-dev is already the newest version (9.0.0-2.1).
libx11-xcb-dev is already the newest version (2:1.6.4-3).
libxcb-dri2-0-dev is already the newest version (1.12-1).
libxcb-dri2-0-dev set to manually installed.
libxcb-dri3-dev is already the newest version (1.12-1).
libxcb-dri3-dev set to manually installed.
libxcb-glx0-dev is already the newest version (1.12-1).
libxcb-present-dev is already the newest version (1.12-1).
libxcb-present-dev set to manually installed.
libxcb-randr0-dev is already the newest version (1.12-1).
libxcb-randr0-dev set to manually installed.
libxcb-render0-dev is already the newest version (1.12-1).
libxcb-render0-dev set to manually installed.
libxcb-shape0-dev is already the newest version (1.12-1).
libxcb-shape0-dev set to manually installed.
libxcb-sync-dev is already the newest version (1.12-1).
libxcb-sync-dev set to manually installed.
libxcb-xfixes0-dev is already the newest version (1.12-1).
libxcb-xfixes0-dev set to manually installed.
libxcb1-dev is already the newest version (1.12-1).
libxi-dev is already the newest version (2:1.7.9-1).
libxrender-dev is already the newest version (1:0.9.10-1).
The following additional packages will be installed:
libxcb-composite0 libxcb-cursor0 libxcb-damage0 libxcb-dpms0 libxcb-ewmh2 libxcb-record0 libxcb-res0 libxcb-screensaver0 libxcb-xf86dri0 libxcb-xrm0 libxcb-xtest0
libxcb-xv0 libxcb-xvmc0
The following NEW packages will be installed:
libxcb-composite0 libxcb-composite0-dev libxcb-cursor-dev libxcb-cursor0 libxcb-damage0 libxcb-damage0-dev libxcb-dpms0 libxcb-dpms0-dev libxcb-ewmh-dev libxcb-ewmh2
libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-record0 libxcb-record0-dev libxcb-render-util0-dev libxcb-res0 libxcb-res0-dev libxcb-screensaver0
libxcb-screensaver0-dev libxcb-shm0-dev libxcb-util0-dev libxcb-xf86dri0 libxcb-xf86dri0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xrm-dev libxcb-xrm0 libxcb-xtest0
libxcb-xtest0-dev libxcb-xv0 libxcb-xv0-dev libxcb-xvmc0 libxcb-xvmc0-dev
I believe that when you configure Qt with -static, you are baking the platform plugin into the build and you won't be able to swap between plugins later on. I'm not certain about this, but I've been down that road and wasn't able to get the qpa switching working, there was only ever one platform plugin listed. If there is a way, I'd be very interested to hear about it!
If I'm correct in this, then to use xcb instead of eglfs, you'll need to reconfigure Qt with the first line of your configure something like:
./configure -no-eglfs -qpa xcb -qt-xcb -opensource -confirm-license -release -static \
Good luck
I have a QT project that was originally developed for Mac and now we are porting it on Linux.
What I would like to do is to build (and Deploy) the project across both platform (Mac and Linux) using the Mac, possibly from QT Creator.
For this reason I need to configure QT Creator (creating a new Kit) adding a Linux Toolchain. I found the appropriate toolchain here:
Linux tool chain for Mac
Unfortunately that toolchain not contains the QT Framework. So I need to cross compile QT from the Mac using the Linux toolchain above.
To cross compile QT I tried this configure parameters (~/gcc-4.8.1-for-linux64/x86_64-pc-linux/ is the Linux toolchain path):
./configure -prefix ~/gcc-4.8.1-for-linux64/qt5.5.0 -xplatform linux-g++ -device-option CROSS_COMPILE=~/gcc-4.8.1-for-linux64/x86_64-pc-linux/ -opensource -confirm-license -no-opengl -make libs -make tools -nomake examples -nomake tests -sysroot ~/gcc-4.8.1-for-linux64/
Unfortunately the command miserably fails with this error
Note: QtSerialBus: Cannot find linux/can.h and linux/can/raw.h Linux headers for socketCAN support.
Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
WARNING: No QPA platform plugin enabled! This will
produce a Qt that cannot run GUI applications.
The dependencies needed for xcb to build are listed in
src/plugins/platforms/xcb/README
ERROR: detected a std::atomic implementation that fails for function pointers.
Please apply the patch corresponding to your Standard Library vendor, found in
qtbase/config.tests/common/atomicfptr
Any thought?
Cheers
I'm currently trying to compile a project and port it to a 32bit target deploying a Linux based system.
My host machine runs x86_64 Debian Stretch and my target is an Atmel SAMA5d2 running a custom Linux.
My cross toolchain is generated from buildroot.
At the moment I'm able to cross compile applications for the target using the buildroot generated toolchain. However, I would like to integrate Qt and build Qt apps for the target.
To be able to build my applications for the targetted platform I need to compile Qt for my target.
To do so I have to tell Qt to use the buildroot toolchain instead of the native one.
From what I found I either have to provide -device <device> --device-option CROSS_COMPILE=$TOOLCHAIN_PATH or -xplatform <mkspec> to configure Qt with the expected toolchain.
Obviously my target is not in the device list under qtbase/mkspecs/devices so I think the best solution is to create a mkspec for my target.
My command should look like this :
./configure -xplatform <my_mkspec> -embedded arm -prefix <customQtPath>
However I'm kinda lost and I don't know how to do it only from documentation and what I found by googling my problem.
Also do I need to specify the target is 32bit as armv7 is only 32bits?
I would be glad to have some help on this.
Thanks.
Your assumptions are correct. You can read similar specs and create your own, those are pretty simple. For instance Pi2 is an armv7 device, you can start from this qmake.conf. Then, pass to configure:
-device <given_name> -device-option CROSS_COMPILE=<path_and_prefix> -sysroot <your_sysroot>
just change paths, tune cflags if needed etc... Then follow build tutorials.
I am trying to install OpenCV on my Windows 10 following this guide. In order to install it with my own-build libraries, I need to build qt from the source. I downloaded the latest sources from the qt page (5.6.0, I didn't find any other sources availible), but after typing
configure -release -no-webkit -no-phonon -no-phonon-backend -no-script - no-scripttools
-no-qt3support -no-multimedia -no-ltcg
In VS2013/VS2015 command promt, I got an error:
Unknown option -no-webkit
Unable to detect the platform from environment. Use -platform command line
argument or set the QMAKESPEC environment variable and run configure again.
I have an option just to make everything. But I have to specify the platform. I didn't find how to do it.
Can anyone give me a hint, how to install qt correctly? I have VS 2013 and 2015. I am going to use VS2013, since VS2015 is not supported by CUDA toolkit 7.5.
Thanks,
Mikhail
Update: I was able to begin the installation process by typing configure -platform win32-msvc2013 -mp -release (although I have win64), but after accepting the licence, I got an error: execute: File or path was not found(nmake). Screenshot is attached
have you tried with the MSVC2013 command prompt:
configure -platform win32-msvc2013 -mp -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg
then type:
nmake
Update:
Also, before that, try adding the path to your Qt source code, with the bin folder, to the PATH variable of windows.
For instance, if your PATH variable is currently set to %SystemRoot%\system32;%SystemRoot%; and your Qt source code is at C:\dev\Qt-5.6\
then set your PATH variable to %SystemRoot%\system32;%SystemRoot%;C:\dev\Qt-5.6;C:\dev\Qt-5.6\bin
This website explains how to change the PATH variable on Windows, in case you're not familiar with it: http://www.computerhope.com/issues/ch000549.htm
Then restart the MSVC2013 Command Prompt, or Windows. I believe that should help the compilation. Let me know if it solves your problem.
What about this:
-skip qtwebkit
Excluding a Qt Submodule
Configure's -skip option allows certain Qt submodules to be excluded from the Qt build. These submodules correspond to the Git submodules in the standard Qt 5 repository. Note that many packages contain multiple Qt modules. For example, to exclude Qt NFC and Qt Bluetooth from the Qt build, provide -skip qtconnectivity as the argument to configure.
I am porting code from qt4 to qt5. I added the following line to my .pro file, as suggested:
QT += webkitwidgets
However, when I run qmake, I get the this error:
Project ERROR: Unknown module(s) in QT: webkitwidgets
I am developing on Ubuntu 12.04 LTS and installed Qt as described.
You need to install the webkitwidgets library.
On Ubuntu, try this in a terminal:
sudo apt-get install libqt5webkit5-dev
On Fedora, the package has a different name, thus try:
sudo apt-get install qt5-qtwebkit-devel
Or on Fedora, via dnf:
sudo dnf install qt5-qtwebkit-devel
If you need to install the webkit* Windows library for Qt 5.7 you should compile it manually because in new version webkit (WebView?) replaced by WebEngine.
Read about Qt 5.7 release (comments): http://blog.qt.io/blog/2016/06/16/qt-5-7-released/
Build sequence (static OR shared):
1) Download Qt 5.7.0 sources: http://download.qt.io/community_releases/5.7/5.7.0/
2) Download required tools: ActiveState Perl (binary), Python (binary), Ruby (binary), GnuWin Bison (binary), GPref (binary), Grep (binary), WinFlex, LibIconv, make (binary), sqlite (source!), ICU (source), windows msys (binary) (unix like shell with the tools), mingw-w64 (bin+dev) for build Qt with QtWebKit, see link on: https://trac.webkit.org/wiki/BuildingQtOnWindows
3) After download ICU source into C:\icu\icu. Open msys QT mingw console shell by open Start windows menu (msys should be downloaded and installed) and search or use fast search. In opened console start configure script and then compile and install:
$ cd C:\icu\icu\source
$ ./runConfigureICU
$ set PATH=%PATH%;C:\msys\1.0\bin\
$ make.exe
$ make.exe install
4) Build Qt with(!) ICU support (set "-icu" to configure) see compile script below. Change PATH to your environment.
Directory structure:
C:\Qt\5.7.0 - download binary version of Qt 5.7.0 here
C:\Qt\5.7.0n - directory for new (compiled) version of 5.7.0 (just make dir)
C:\Qt\Src - download source of Qt 5.7.0 here
C:\Qt\Src\qtbase\compile.bat
set INCLUDE=C:\icu\icu\dist\include
set LIB=C:\icu\icu\dist\lib
set QTDIR=C:\Qt\5.7.0n
set PATH=%PATH%;C:\Qt\Qt5.7.0\5.7\mingw53_32\bin;C:\Qt\Qt5.7.0\Tools\QtCreator\bin;C:\Qt\Qt5.7.0\Tools\mingw530_32\bin;C:\Qt\Src\qtbase\bin;C:\Program Files (X86)\GnuWin32\bin;C:\winflex;C:\Ruby23-x64\bin;C:\Python27;C:\mingw-w64\i686-1\mingw32\bin;C:\icu\bin
set QMAKESPEC=win32-g++
set BUILD_DIR=C:\Qt\Qt5.7.0n
call C:\Qt\Src\qtbase\configure.bat -prefix %BUILD_DIR% -platform %QMAKESPEC% -confirm-license -debug-and-release -opensource -opengl desktop -no-compile-examples -icu -I C:/icu/icu/dist/include -L C:/icu/icu/dist/lib
jom.exe -j 4
pause
Run command in exmaple in Windows Power Shell:
$ cd C:\Qt\Src\qtbase
$ ./compile.bat
After pass through compile use it to install files in the BUILD_DIR (install Qt files):
$ C:\mingw-w64\i686-1\mingw32\bin\mingw32-make.exe install
Qt should start to install
5) Download Qtwebkit sources to C:\Qt\Src\qtwebkit. Use compile script below to compile the qtwebkit using new Qt 5.7.0 build with files in C:\Qt\5.7.0n with ICU.
C:\Qt\Src\qtwebkit\Tools\Scripts\compile.bat
set INCLUDE=C:\sqlite
set LIBS=C:\sqlite
set SQLITE3SRCDIR=C:\sqlite
set QTDIR=C:\Qt\Qt5.7.0n
set PATH=%PATH%;C:\Qt\Qt5.7.0n\bin;C:\Qt\Src\qtbase\bin;C:\winflex;C:\Ruby23-x64\bin;C:\Python27;C:\mingw-w64\i686-1\mingw32\bin;C:\icu\bin;C:\Program Files (x86)\GnuWin32\bin
set QMAKESPEC=win32-g++
call perl.exe .\build-webkit --qt --release
Compile the qtwebkit:
$ cd C:\Qt\Src\qtwebkit\Tools\Scripts
$ ./compile.bat
$ cd C:\Qt\Src\qtwebkit\WebKitBuild\Release
$ C:\mingw-w64\i686-1\mingw32\bin\mingw32-make.exe install
It should be possible to compile your application with the qtwebkit after successfull compile and install.
BUILD QT FOR STATIC
Edit file C:\Qt\Src\qtbase\compile.bat and pass through build.
...
call C:\Qt\Src\qtbase\configure.bat -prefix %BUILD_DIR% -platform %QMAKESPEC% -confirm-license -debug-and-release -opensource -opengl desktop -static -no-compile-examples -icu
echo "QMAKE_FLAGS += -static -static-libgcc" >> .mkspecs/%QMAKESPEC%/qmake.conf
...
POSSIBLE ERRORS
1) While build qtwebkit: "fatal error: unicode/uchar.h: No such file or directory"
Check that your Qt 5.7.0n build with ICU. IT also could notify you about "ICU required" at configure in qtwebkit.
2) flex: unknown flag '-'. For usage, try
You should use correct version of Flex that is "win_flex" in this case. You should rename files to use win_flex instead of just flex (and bison).
1) rename C:\Program Files (x86)\GnuWin32\bin\flex.exe to some unused name.
2) rename C:\Program Files (x86)\GnuWin32\bin\bison.exe to some unused name.
3) rename C:\winflex\win_bison.exe to bison.exe.
3) While build qtwebkit: "fatal error: sqlite3.h: No such file or directory"
Edit file C:\Qt\Src\qtwebkit\Tools\Scripts\compile.bat and check for correct path to sqlite:
set SQLITE3SRCDIR=C:\(path to some SQLITE .h/source files)
4) skipping incompatible ... when searching for ...
You should download right library arch (32bit or 64bit)
5) View.cpp ... undefined reference to WKPageCanGoBack
Could happens when pass through some test or MiniBrowser. You can search in files for the "UIProcess/API/qt" and "MiniBroswer" and remove it from
Makefile's and some other files and then start build again.
LINKS
Build Qt5: https://wiki.qt.io/Building_Qt_5_from_Git Qt WebKit build
like how to: https://trac.webkit.org/wiki/BuildingQtOnWindows ICU
build with GNU: https://wiki.qt.io/Compiling-ICU-with-MinGW
The community builds referenced by Alex are only available until Qt 5.9.
If you want to use newer Qt5 (current version is 5.11), then another option is to port "QtWebKit" to "QtWebEngine".
See: https://wiki.qt.io/QtWebEngine/Porting_from_QtWebKit
I got it to work by copying the webkit and webkitwidgets pri files from a previous installation, 5.5.
~/Qt/5.5/clang_64/mkspecs/modules/
For windows, I just downloaded https://github.com/annulen/webkit/releases/tag/qtwebkit-tp5 and copied the folders to relevant Qt installation folder. Now I can use MinGW Qt5.8 with latest webkit. Thanks to Konstantin and all the contributors for this project!
Only one thing to note - I needed to use the release configuration in Qt.
What works for me is the combination of two answers, I used what #user1251007 suggested + this command
sudo apt-get install libqt5websockets5-dev
find this command line here : link to the stackoverflow response