*still* having problems building Qt (static)
-
Hi all -
This seems like a problem that just keeps coming up...this time I'm trying to build Qt 5.14.2 (static).
Here are the steps I followed:
- $ git clone https://code.qt.io/qt/qt5.git
- $ cd qt5
- $ git checkout v5.14.2 // or whatever
- $ git submodule update --init --recursive
- $ configure -confirm-license -static -static-runtime -opensource -release -platform win32-g++ -opengl desktop -nomake examples -nomake tests -nomake tools -recheck-all -prefix c:\qt5\5.14.2\static
and here's the configure error:
In file included from C:/qt/qt5/qtbase/qmake/generators/makefiledeps.cpp:36:0: C:/qt/qt5/qtbase/mkspecs/win32-g++/qplatformdefs.h:55:10: fatal error: direct.h: No such file or directory #include <direct.h> ^~~~~~~~~~ compilation terminated.
Any ideas what's going on now? Thanks...
-
@mzimmers https://en.wikipedia.org/wiki/Direct.h
On my Windows machine it is located in MinGW installation.
How did you install MinGW? -
@jsulm I didn't install MinGW manually; I selected it during my Qt installation.
I wonder if the problem has something to do with the state of my Qt directory. I have subfolders "5.14.2" and "Qt5.14.1" but Qt 5.14.2 isn't auto-detected by creator.
I also notice that when I go to https://code.qt.io/qt/ in a browser, I'm redirected to a cgit folder. Seems like there have been some changes to how Qt is to be installed; I wonder if I should just start over.
-
@mzimmers said in *still* having problems building Qt (static):
I didn't install MinGW manually; I selected it during my Qt installation
Same for me and I have that file and it does not depend on installed Qt versions, it's part of MinGW.
-
@mzimmers It is available: https://www.qt.io/download-thank-you?os=windows&hsLang=en
-
@B3lette I do have those components installed, and my path includes the bin directory. The file direct.h is in C:\Qt\Tools\mingw730_32\i686-w64-mingw32\include; are you saying that I have to add the include directory to my path as well?
Thanks...
-
@mzimmers said in *still* having problems building Qt (static):
@B3lette I do have those components installed, and my path includes the bin directory. The file direct.h is in C:\Qt\Tools\mingw730_32\i686-w64-mingw32\include; are you saying that I have to add the include directory to my path as well?
Thanks...
No it should be ok ... So it doesn't seem to come from your minGW installation process.
Is "sh.exe" in your path ? See : https://bugreports.qt.io/browse/QTBUG-28845
I'm not sure about your c:\ in prefix either, maybe it should be relative to the partition's root, like "-prefix qt5\5.14.2\static"@mzimmers said in *still* having problems building Qt (static):
@jsulm thanks for that link, but I'm still unclear on something -- how did you navigate to that path? What I mean is, what is the URL to get to that page?
Click on :
- "Download. Try. Buy" on the upper right hand corner on any qt page
- In the category "Downloads for open source users", click on "Go open source"
- Scroll all the way down to the link "Download the Qt Online Installer"
-
@B3lette thanks for the direction to the download page.
I do have sh.exe in my path. The procedure I listed above used to work. I decided to re-install Qt from scratch. I'm now doing the submodule update step, which takes a long time, probably because I didn't exclude any submodules (I need to learn how to do that). When it's done, I'll try the configure command again.
Thanks...
-
No problem, I am currently completely studying the same things and thought I could help here ...
See https://wiki.qt.io/Building_Qt_5_from_Git#Getting_the_submodule_source_code for infos on init-repository.
Personally i did --module-subset=essential,-qtdoc because that was what I needed. -
@B3lette oh, I guess that's one of the advantages of using the init-repository script -- you can include/exclude the modules as desired.
I'd be interested to know whether, after you've built a Qt library, whether you can go back and add modules should the need arise. Qt's build system has been known to be a little fussy in the past.
-
UPDATE: after going through the procedure again, but using the init-repository script, the configure failed again, just as noted above. Then I read the fine print:
../qt5/configure
and inferred from it that the configure command must be using its own relative pathnames to find files like direct.h. So I ran from my already-installed Qt instead, and the configure command succeeded. Now, we'll see how the build does.
Progress, anyway...
-
Ok, happy it succeeded !
Qt building is meant to be made shadow : after your checkout and repo init, you should create another directory, cd into it and call configure from it.
See my first post here for a nice batch script doing it : https://forum.qt.io/topic/113984/cross-compilation-from-windows-to-aarch64 -
@B3lette yeah, I'm still not sure if I fully understand all that's going on, but evidently, not only do you have to build into another directory, but you have to use the configure command that exists within the already-built Qt space.
Anyway, the make and make install worked, and I have my static build.
Thanks to everyone who looked and helped.