I try to build Qt 5.4 from scratch including WebKit with ICU/Unicode support for Windows using VS2013. According to Qt's manuals I'm first setting the environment variables to point to the 32 bit binaries of ICU as downloaded from their webpage:
SET INCLUDE=D:\Qt\icu\include;%INCLUDE%
SET LIB=D:\Qt\icu\lib;%LIB%
SET PATH=D:\Qt\icu\include;D:\Qt\icu\lib;%PATH%
Next I'm doing a configure
configure.bat -commercial -confirm-license -debug-and-release -release -force-debug-info
-nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng -plugin-sql-sqlite
-no-openssl -opengl dynamic -icu -I D:\Qt\icu\include -L D:\Qt\icu\lib
-prefix D:\Qt\Qt5.4.1\install\
This results in folllowing outputs:
Third Party Libraries:
...
ICU support.............yes
Additional libraries........-LD:\Qt\icu\lib
But after doing "nmake" and "nmake install" I end up with Webkit-DLL's that do not depend on ICU and therefore fail to display my webpages containing Unicode.
So...any idea what is wrong here and why Qt does not make use of ICU although it recognises it correctly and does not show any build/link errors?
Thanks!
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.
My head will explode soon... I want to compile qt with -openssl-linked so the openssl libraries get linked into the qt libraries. I already tried many options and my output when compiling is always:
ssl/qsslcertificate_openssl.cpp: In function ‘uint qHash(const QSslCertificate&, uint)’:
ssl/qsslcertificate_openssl.cpp:63:30: error: invalid use of incomplete type ‘X509 {aka struct x509_st}’
return qHashBits(x509->sha1_hash, SHA_DIGEST_LENGTH, seed);
^
In file included from /usr/local/include/openssl/crypto.h:131:0,
from /usr/local/include/openssl/comp.h:59,
from /usr/local/include/openssl/ssl.h:148,
from ../../include/QtNetwork/5.5.1/QtNetwork/private/../../../../../src/network/ssl/qsslcontext_openssl_p.h:53,
from ../../include/QtNetwork/5.5.1/QtNetwork/private/qsslcontext_openssl_p.h:1,
from ssl/qsslsocket_p.h:55,
from ssl/qsslsocket_openssl_p.h:63,
from ssl/qsslsocket_openssl_symbols_p.h:64,
from ssl/qsslcertificate_openssl.cpp:35:
/usr/local/include/openssl/ossl_typ.h:160:16: note: forward declaration of ‘X509 {aka struct x509_st}’
typedef struct x509_st X509;
I compiled openssl and tried compiling qt passing my compiled libraries:
OPENSSL_LIBS='-L/opt/openssl_build/lib -lssl -lcrypto' ./configure -prefix /opt/qt5.5.1_linux_staticssl -opensource -confirm-license -release -nomake examples -nomake tests -static -openssl -no-opengl -no-libpng -no-pulseaudio -no-linuxfb -no-gif -no-gstreamer -no-gtkstyle -no-directfb -no-gui -no-eglfs -no-glib -I /opt/openssl_build/include/openssl -L /opt/openssl_build/lib -no-xcb
I know the error seems to be loading the old openssl libraries but I already tried changing that path so it can't find them and force it to load the new ones.
I don't know what else to do. The Qt version is 5.5.1 openssl 1.0.1 and g++ 5.2.
I had to build Qt with the openssl version 1.0.1, don't know if it work with the 1.0.2. I had to change the path of the system's openssl libraries so that Qt was forced to use the ones I made.
Lines to compile openssl running at the source's directory:
./config --prefix=/opt/openssl_build_stable -shared
make
make test
sudo make install
My conf line for Qt:
OPENSSL_LIBS='-L/opt/openssl_build_stable/lib -lssl -lcrypto' ./configure -prefix /opt/qt5.5.1_linux_staticssl -opensource -confirm-license -release -nomake examples -nomake tests -static -openssl-linked -I /opt/openssl_build_stable/include/openssl -L /opt/openssl_build_stable/lib
Thanks to simon-warta
Try ./configure -no-openssl
to bypass openssl altogether, in case you don't need your paraView to talk to another machine.