Static Qt build (Windows) missed some libraries
-
Hi all -
Not sure what's going on here. On system "A", I built a Qt version using the steps here (more or less). Build my app just fine. On system "B", I followed seemingly the same steps, but when I try to build my app, I get a handful of errors:
:-1: error: cannot find -lfontconfig
same error for lfreetype, ljpeg, ltiff, lwebp, lwebpdemux, lwebmux, lpng16.
So:
-
what did I do wrong?
-
can I add the missing libraries somehow, or do I need to start from scratch?
Thanks...
-
-
@mzimmers said in Static Qt build missed some libraries:
fontconfig
on Ubuntu
sudo apt-get -y install fontconfig -
@mzimmers
When you ask a question like this please always state your platform, and in the case of Windows whether you are using MSVC of MinGW, we cannot guess/remember!Also please give some context to the error (e.g. from the Build Output pane). I had initially thought this was an error from the linker, indicating it cannot find the libraries. However looking at
:-1: error: cannot find -lfontconfig
is that actually an error from qmake/the
Makefile
, indicating that it sees a file/target named-lfontconfig
which it cannot find?Answer going forward depends on the above....
-
@mzimmers
When you ask a question like this please always state your platform, and in the case of Windows whether you are using MSVC of MinGW, we cannot guess/remember!Also please give some context to the error (e.g. from the Build Output pane). I had initially thought this was an error from the linker, indicating it cannot find the libraries. However looking at
:-1: error: cannot find -lfontconfig
is that actually an error from qmake/the
Makefile
, indicating that it sees a file/target named-lfontconfig
which it cannot find?Answer going forward depends on the above....
-
@JonB sorry about that...platform is now in title.
My kit is using the MinGW 8.1.0 32-bit compilers.
The error is indeed coming from the linker. QMake runs fine.
Thanks...
@mzimmers
OK, well, if it is the linker, search your whole disk forlibfontconfig.a
, there are two possibilities:- You have the file(s) somewhere but not being found. Tell it where to find them.
- You do not have the files anywhere. Check what you have installed/re-install.
-
@mzimmers
OK, well, if it is the linker, search your whole disk forlibfontconfig.a
, there are two possibilities:- You have the file(s) somewhere but not being found. Tell it where to find them.
- You do not have the files anywhere. Check what you have installed/re-install.
@JonB when you say "reinstall," do you mean I have to perform the entire build again, or is there a mechanism for telling the configure command to perform an incremental operation.
Does configure have an option to "undo" itself - to return the repo to an unaltered state, or is it OK to just do this with a git reset? (I'm trying to minimize the time taken to perform the configure/build steps, as they're quite long on my system.)
Oh: the file libfontconfig.a doesn't exist even on my system "A" where the build works. So, it seems like I made some kind of mistake in the configuration.
Thanks...
-
Hi, don't know if this helps, but I recognize that error message from when building a static Qt 6.3.0 version on Ubuntu 22.04 using gcc 11.2.0. The cure on Ubuntu is:
sudo apt install libfontconfig-dev
but that's not applicable on Windows 10 :-(Check your configure command line, perhaps there's a
-fontconfig
that causes the error? If so try removing it... -
Hi, don't know if this helps, but I recognize that error message from when building a static Qt 6.3.0 version on Ubuntu 22.04 using gcc 11.2.0. The cure on Ubuntu is:
sudo apt install libfontconfig-dev
but that's not applicable on Windows 10 :-(Check your configure command line, perhaps there's a
-fontconfig
that causes the error? If so try removing it...@hskoglund my configure command doesn't have anything like that. Here's what I'm currently using:
$ configure -confirm-license -static -static-runtime -opensource -release -platform win32-g++ -opengl desktop -skip qtwebengine -nomake examples -nomake tests -nomake tools -recheck-all -prefix c:\qt\5.15.2_static
Again, what's really confusing is that my other system (the one that works) doesn't have that library anyway, so somehow, on this system, I'm introducing a false dependency...I just don't know how I'm doing that.
-
Do any of your 2 Windows 10 systems have WSL or WSL2 installed? Perhaps those messes with your build somehow...
@hskoglund both of them do. But, how would that be affecting this?
-
I've been playing with this today, and I just discovered that my commands are building a 64-bit Qt library, which 1) isn't what I intended, and 2) might be part of the problem. I've looked at the options for the configure command, and I don't see a way to specify that I want a 32-bit library. Can someone advise me on what to do here?
EDIT: I even added these entries in the qt.pro file to:
CONFIG -= x86_64 CONFIG += x86
Somehow, my build still insists on creating a a Qt library with a profile x66-windows-msys-pe-64bit. WHAT am I doing wrong?
Thanks...
EDIT 2: this question is really a different subject, so I'm going to ask it in a different thread. Leaving this one open for now until I get to the bottom of the missing libraries.