A very simple question.
I am building qt under linux(CentOS to be exact), and I've been having trouble migrating from QT 4.8.4 to QT 5.0.2.
The current configuration for QT 4.8.4(and also want it the same in 5.0.2) is
./configure $QTCONFARGS -confirm-license -release -no-phonon -no-webkit -no-multimedia -no-sql-odbc -prefix
On 5.0.2, I get errors on no phonon, no webkit, and no multimedia.
I read the help for configurations, and I found none of these.
Question is, what the equivalent of these three cofigurations?
See this page from Qt documentation. Note that
Phonon was dropped in Qt 5.
The option to leave webkit out is --no-webkit (note double dashes) in init-repository and -no-webkit in configure (only single dash).
To skip multimedia, use --no-multimedia or -no-multimedia similarly to above.
Related
My ssd died and I had to reinstall Qt, Im using the same version as before (5.15.2, Qt Creator 6.0.2 and MSVC2019). Described problems appears only while using Static build.
This type (ApplicationWindow) is not supported as a root (Im not 100% sure if it was fine before reinstall)
Invalid property name "title, maximumHeight, maximumWidth, minimumHeight, minimumWidth".
And finally after resolving (Changed from ApplicationWindow to Window, and commented Invalid Properties) these two errors I got: Line 1: Qt Quick emulation layer crashed. I attached a debugger to Qt Creator and it's 0xC0000005 on Editor, Preview and Render.
I tested it in both ways, with latest Qt Creator (installed before making Static kit because it will wipe my Qt directory) and with Qt Creator 6.0.2 (installed after making Static kit).
To compile Static Kit I used this script, but after some problems (jom and jom install did not create any files in QtInstallDir) I just run configure.bat by myself, and then jom and jom install and files were in their place.
The solution can be:
Designing using diffrent kit with Window and then on release change Kit to static, change Window to ApplicationWindow (Im using onClosing from ApplicationWindow).
but it's dirty and I personally do not like it. Is there any other solution?
EDIT: non-static versions are fine (self-compiled and one from MaintenanceTool).
Static configure.bat:
configure.bat -prefix %QTINSTALLDIR% -platform %PLATFORM% -opensource -debug-and-release -confirm-license -opengl dynamic -mp -static -static-runtime -no-shared -qt-libpng -qt-libjpeg -qt-zlib -qt-pcre -no-compile-examples -nomake examples -no-icu -optimize-size -qt-sqlite -openssl-linked OPENSSL_PREFIX=%SSLINSTALLDIR%
Non-static configure.bat:
configure.bat -prefix %QTINSTALLDIR% -platform %PLATFORM% -opensource -debug-and-release -confirm-license -opengl dynamic -mp -no-compile-examples -nomake examples -optimize-size -qt-sqlite
Diffrence:
-static -static-runtime -no-shared -qt-libpng -qt-libjpeg -qt-zlib -qt-pcre -openssl-linked OPENSSL_PREFIX=<location>
Okay, I fixed the Invalid property name .., I dont know what really fixed it but:
I had wrong versions of requirements. I was on latest of Ruby, Python etc.
I installed Submodules one more time using script linked in main post and then installed them one by one by my own hands using qmake then jom clean all then jom install.
Also I found that the Line 1: Qt Quick emulation layer crashed. error appear only when I have QtQuick.Controls <any_version> in imports. Im still trying to fix this.
Fixed. I did this by doing those steps:
In maintenance tool I downloaded Mingw64 and Mingw64 for 5.15.2 and for "Tools".
I did an static mingw build using this powershell script: https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW
I saw that the script is changing qmake.conf files in mkspecs folder. I ran this MSVC script to make MSVC Static build and after unzipping QtBase I modified qmake.conf in mkspecs/winrt-x64-msvc2019 and in mkspecs/win32-msvc.
QMAKE_LFLAGS += -static
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE += -Os
DEFINES += QT_STATIC_BUILD
Then the qt setup and qt build command, when build is finished I modified the (THIS TIME IN PREFIX LOCATION / LOCATION WHERE QT STATIC IS INSTALLED) qmake.conf in mkspecs/winrt-x64-msvc2019 and in mkspecs/win32-msvc
CONFIG += static
Run Qt Creator and the Designer is fine.
After successfully building static QT and my application binary on Linux I moved to Windows to try out the same.
..\qt-everywhere-src-5.12.8\configure.bat -opensource -confirm-license -release -static -static-runtime -no-pch -optimize-size -opengl desktop -platform win32-g++ -prefix "C:\Qt\Static" -skip webengine -nomake tools -nomake tests -nomake examples
mingw32-make -j4 && mingw32-make install
My development environment is Windows 10 x64, MinGW 7.3.0, QT 5.12.8 Static (Built with above cmdline). Now my problem with deployment is:
Strangely the binary is running on a fresh copy of Windows 10, but not on Windows 7. More surprisingly I tried to run the binary on Linux Wine, and voila it worked there as well.
Another problem is related to custom font loading, i.e. QFontDatabase::addApplicationFont also fails on Windows static build. Whereas same code works well on Linux static build or Windows dynamic QT linking. I tried Q_INIT_RESOURCE based on some stackoverflow post but that didn't help.
I tried reading several qt wiki articles but nothing has helped so far for both of the above problems.
Edit #1
Here is the font loading code which is failing on static build:
Q_INIT_RESOURCE(qml);
int idFont = QFontDatabase::addApplicationFont(":/fonts/Comfortaa-Bold.ttf");
if (idFont == -1)
{
qDebug() <<"Failed to load font from resource";
....
Edit #2
There is a new hope. I have just tried building a simple widget application and build that statically with same Qt version. Now it works on fresh Windows 7. So I need to figure out why QML application is not working. Do I need to do anything specific for qml modules or plugin during Qt static build?
Edit #3
Fixed Windows 7 execution issue by changing VM settings.
Fixed the font loading issue by rebuilding Qt. This time I used Qt 5.15.0 and command line was:
configure.bat -opensource -confirm-license -prefix "C:\Qt\5.15.0-Static" -release -static -static-runtime -opengl desktop -platform win32-g++ -make libs -qt-libpng -qt-libjpeg -qt-freetype -qt-zlib -nomake tools -nomake examples -nomake tests -skip qttools
The problem was with VirtualBox display driver which by default doesn't support OpenGL. When I turned on the 3D acceleration in VirtualBox settings the Qt Qml static application worked. This also justifies why my statically linked application worked on Windows 10 as those were installed on direct hardware, not on VM, thus was using proper underlying driver and opengl.
So this implies when you use -opengl desktop flag it uses underlying operating system's opengl library and even though mingw links with -lopenglw32 it still depends on system's opengl.
I recently did a Qt 5.9.2 Static build using the command
configure -c++std c++11 -prefix C:\Qt\install -platform win32-msvc2017 -release -opensource -static -static-runtime -no-compile-examples -opengl desktop -nomake examples -nomake tests
The build works fine, and I'm able to create standalone executables for simple applications. However, when I try to load a QML application, the resolution looks bad and my mouse does not map with the GUI correctly. It seems that the application thinks the mouse is higher than it actually is.
I also receive many errors like this one in my program
ShaderEffect: Failed to read :/QtQuick/Controls/Shaders/blur.vert
The program uses a slider and the knobs on it are black boxes.
The programs look and work fine when I switch to my dynamic kit.
I do notice there is a warning saying "No qmlscene installed", could this be related?
How do I fix these issues?
Qt 4.8.4 built manually with mingw 4.7.2. My problem in subject. I think it's connected with manifest-file, but I'm not sure and I don't know how to solve this problem.
Qt sources I've got from the official site.
Options of configuration if needed
configure -debug-and-release -no-exceptions -nomake demos -nomake examples
PS: sorry for my english, it's not my native language
Looks like Qt forgot to build windows styles. Run configure --help and look for available options, somewhere closer to the end there are styles. Maybe on mingw appropriate windows style wasn't auto-detected.
I'm trying to build Qt on Windows with the following command:
configure -static -opensource -no-webkit -no-qt3support -no-audio-backend -no-exceptions -no-opengl -no-phonon -phonon-backend
and I get this error:
Unable to detect the platform from environment. Use -platform command lineargument
However I don't know what are the different possible values for the "-platform" argument. I tried "win32" and "windows" but none of them are right. I can't find any reference that would list the possible values. Does anybody know what I need to put for Windows 7 (developing with Qt Creator)?
Open mkspecs folder inside qt dir. There you can see multiple folders. Names of this folders are values for -platform switch.
For example, you can use win32-msvc. msvc means using MS visual studio compiler for buiding qt.
Answer found on this topic in russian language.
You should try -platform with those arguments:
win32-g++ (for mingw)
win32-icc (for intel)
win32-msvc (for visual studio)