I am new in Qt and Yocto. I used Poky toolchain to cross-compile Qt5 on Ubuntu 12.04.LTS.
I installed and configure Qt5 following these instructions for Building Qt5 using yocto on Wandboard.
/configure v -dont-process -opensource -confirm-license -device imx6 -device-option CROSS_COMPILE=/opt/poky/1.5.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi -sysroot /fsl-community-bsp/buildcoreimage/tmp/sysroots/imx6qsabreauto -prefix ~/qt5arm -platform linux-g++ -shared -no-pch -no-rpath -pkg-config -no-accessibility -no-dbus -no-icu -no-directfb -evdev -no-fontconfig -no-opengl -opengl es2 -eglfs -no-glib -no-gtkstyle -no-iconv -system-libjpeg -no-kms -system-libpng -no-linuxfb -no-mitshm -no-nis -openssl -qt-pcre -release -no-sm -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-sql-tds -nomake tests -tslib -libudev -widgets -no-xcb -no-xcursor -no-xfixes -no-xinerama -no-xinput -no-xinput2 -no-xkb -no-xrandr -no-xrender -no-xshape -no-xsync -no-xvideo -system-zlib
When i tried to build my project with qmake I got the following error:
hmi_ph2$ /home/abc/qt5arm/bin/qmake
Project ERROR: Unknown module(s) in QT: webkitwidgets webkit
so I did
sudo apt-get upgrade libqt5webkit5-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
in my .pro file:
QT += qml quick xml network widgets webkit webkitwidgets xmlpatterns multimedia multimediawidgets
You just need to link against webkit, not webkitwidgets : http://qt-project.org/doc/qt-5/qtwebkitwidgets-index.html
So in your case you have to remove webkitwidgets from the line QT += ....
EDIT : As pointed out by Laszlo Papp, the problem is not there. After looking at the configure option for Qt (from the 4.8 doc : http://qt-project.org/doc/qt-4.8/configure-options.html), there is a -webkit option. I do not know if this option still exist for Qt5 as I couldn't find the full option list in Qt5 Doc (http://qt-project.org/doc/qt-5/configure-options.html), but if you try configure -help you 'll see if it exist. If that is the case then it might be your missing piece.
Related
My Qt5.7 is statically built with VS2015 in windows 10. The building configurations are as follows:
configure -static -debug-and-release -platform win32-msvc2015
-qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop
-qt-sql-sqlite -qt-sql-odbc -no-openssl -opensource -confirm-license
-make libs -nomake tools -nomake examples -nomake tests
It is found that the built Qt has no QtSVG module after I type QT += svg in a .pro file. Does the building process build all Qt modules? I obtained the Qt source from here[qt official releases][1]
I want to add the QtSvg module, but do not want to rebuild the whole Qt, which is too time-consuming. Is there any simple way to add the module?
That is to install the module to the qtbase include folder, more specifically, C:\Qt\5.7.0\qtbase\include\QtSvg.
I'm trying to compile a QT from the source code under Windows using the script from the official instructions. (https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW)
cmd /c "configure.bat -static -debug-and-release -platform win32-g++ -prefix $QtDir `
-qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sql-sqlite -no-openssl -opensource -confirm-license `
-make libs -nomake tools -nomake examples -nomake tests"
mingw32-make -k -j4
mingw32-make -k install
In the result I got two problems:
1) build options:
OpenGL:
ANGLE ................................ no
Desktop OpenGL ....................... no
Dynamic OpenGL ....................... no
OpenGL ES 2.0 ........................ yes
OpenGL ES 3.0 ........................ no
OpenGL ES 3.1 ........................ no
OpenGL ES 3.2 ........................ no
Vulkan ................................. no
2) fatal error: GLES2/gl2.h: No such file or directory
I tried to set all possible options for the "-opengl" parameter, none worked.
I have installed the directive which is required for ANGLE and the paths in PATH are written, but the installation still does not find it. Also, in the source directory, next to each file that requires GLES2, there are all necessary headers.
I tried to manually download the ANGLE library and write a path to it in PATH, but this did not work.
The same problems were describe in
http://www.qtcentre.org/threads/53752-Error-compiling-qt5-01-on-indovs
https://bugreports.qt.io/browse/QTBUG-59996
but the solutions did not help me.
Search for missing files in the qt folder, copy their parent folders such as GLES2 or KHR to MinGW\x86_64-w64-mingw32\include. It's just brutal force.
I am trying to cross compile the latest Qt (version 5.9) for the raspberry pi compute module. I am quite new to this but found this guide very helpful: https://visualgdb.com/tutorials/raspberry/qt/embedded/
I followed the instruction but when it comes to configuring qt, I have the following command as suggested in the guide (I have replaced version 5.5 with 5.9):
../qt-everywhere-opensource-src-5.9.0/configure -platform win32-g++ -xplatform linux-arm-gnueabi-g++ -release -opengl es2 -device linux-rasp-pi2-g++ -sysroot C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5
In my case this throws the error that I cannot specify both the xplatform and device parameters. I am new to this and I am not sure which one of the two should be specified!
When you select mkspec for configure you can select a host platform with -platform, or when cross-compiling you can select target platform with -xplatform. When cross-compiling for a specific supported device you select the mkspec with -device. You can give options for the specific device with -device-option flag. When using -device flag you don't use -xplatform flag.
In Qt, there seems to be a device mkspec for Raspberry Pi 2. You can find Qt mkspecs from qtbase module in Qt source tree, e.g. Raspberry Pi 2 mkspec: qt-everywhere-opensource-src-5.9.0/qtbase/mkspecs/devices/linux-rasp-pi2-g++.
There is Raspberry Pi Beginners Guide in Qt wiki which might be helpful. It says you should initially build qtbase and then compile other modules one by one. In the wiki there is an example configure command for Raspberry Pi 2 (in Linux host env) which uses -device and -device-option flags:
./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi
make -j 4
sudo make install
I have followed the instructions on this page Building Qt 5 from Git to build Qt 5.5 from source. The source is in "~/qt5_source_built/qt5" and the Qt 5.5 built system is in "~/qt5_source_built/qt5.5-build". I have used the following config options :
~/qt5_source_built/qt5/configure -developer-build -opensource -no-gtkstyle -nomake examples -nomake tests
and then used "make -j4" to build the qt-5.5 system. The system builds OK.
I use CMake to develop applications for the Qt 5.5 built system. It works for the usual cases (e.g. could use qtwebkit). However, when I want to test the qtwebengine module on a new application, I find that there seems NO qtwebengine include files and library files under the "~/qt5_source_built/qt5.5-build/qtbase" directory.
I have tried to re-make the system using different targets :
make all -j4
make module-qtwebengine -j4
make module-qtwebengine-all -j4
but the console keeps outputing
... Nothing to be done for ...
and the qtwebengine include and library files still could NOT be found under the "~/qt5_source_built/qt5.5-build/qtbase" directory after the re-make.
I notice that the qtwebengine source files seems could be found in "~/qt5_source_built/qt5/qtwebengine/src" but I just could not build it using the "make" command.
Have I just missed the qtwebengine include and library files under the built directory ? If not, does anyone know how could I build qtwebengine using this Qt 5.5 git source ?
Thanks for any suggestion.
The following ended up working. I installed all of these prereqs. If they were missing, QtWebEngine wouldn't build. make module-qtwebengine usually printed out the reason it didn't build it:
sudo apt-get install bison build-essential flex gperf gyp \
libasound2-dev libbz2-dev libcap-dev libcups2-dev libdrm-dev \
libegl1-mesa-dev libfontconfig1-dev libgcrypt11-dev \
libglu1-mesa-dev libicu-dev libnss3-dev libpci-dev libpulse-dev \
libssl-dev libudev-dev libxcomposite-dev libxcursor-dev \
libxdamage-dev libxrandr-dev libxtst-dev ninja python ruby
Then I used the following configuration. Not sure if this is minimal but it worked:
./configure -release -opensource -confirm-license -shared \
-no-sql-sqlite -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype\
-icu -openssl -qt-xcb -opengl -gui -widgets -skip webkit \
-nomake examples
Note that I skipped webkit, and also I use -shared instead of -static since static linking of QtWebEngine is apparently not yet supported.
I'm running Qt Creator 2.4.1 under Windows 7. It works fine with the .dll libraries shipped with the SDK under C:\QtSDK
Recently, I built 4.8.2 libraries from source under C:\qt-source like this:
configure -platform win32-g++ -no-phonon -no-phonon-backend -no-webkit \
-fast -debug -opensource -shared -no-qt3support -no-sql-sqlite \
-no-openvg -no-gif -no-libpng -no-libmng -no-libtiff -no-libjpeg \
-no-script -no-scripttools -nomake examples -nomake demos -no-xmlpatterns
mingw32-make
To link against the new libraries, I added Manual Qt 4.8.2 C:\qt-source\4.8.2\bin\qmake.exe under Tools > Options > Build & Run > Qt Versions. However, Qt Creator still seems to pick up .dll libs from C:\QtSDK