Static compile error Qt5.12.0: bootstrap-private
-
Hi, I try to compile Qt5.12.0 into static lib using the following commands:
$ mkdir qt5.12.0-static-build $ cd qt5.12.0-static-build $ ~/Qt/5.12.0/Src/configure -static -prefix ~/qt5.12.0-static-build -fontconfig -nomake tests -nomake examples $ make
Error:
make[3]: Leaving directory '/home/desaysv-zq/qt5.12.0-static-build/qtbase/src/tools/bootstrap' cd tools/moc/ && ( test -e Makefile || /home/desaysv-zq/qt5.12.0-static-build/qtbase/bin/qmake -o Makefile /home/desaysv-zq/Qt/5.12.0/Src/qtbase/src/tools/moc/moc.pro ) && make -f Makefile Project ERROR: Unknown module(s) in QT: bootstrap-private Makefile:94: recipe for target 'sub-moc-make_first' failed make[2]: *** [sub-moc-make_first] Error 3 make[2]: Leaving directory '/home/desaysv-zq/qt5.12.0-static-build/qtbase/src' Makefile:48: recipe for target 'sub-src-make_first' failed make[1]: *** [sub-src-make_first] Error 2 make[1]: Leaving directory '/home/desaysv-zq/qt5.12.0-static-build/qtbase' Makefile:83: recipe for target 'module-qtbase-make_first' failed make: *** [module-qtbase-make_first] Error 2
I'm running on Ubuntu16.04.
Any help?
-
Hi,
Did you download the sources using the MaintenanceTool ?
-
I downloaded the source using qt-unified-linux-x64-3.0.6-online.run.
Btw, deleting the -prefix option in configure works just fine. Weird.
-
@dalishi Were you able to solve it? I've run into same issue. I'm trying on windows though.
-
-
@SGaist But then it will install Qt to "C:\Qt\Qt-5.12.0", instead of my preference "C:\Qt\Static\5.12.0"?
-
You asked what @dalishi did, I didn't say it would be the best solution. As for the default prefix used, I don't currently know.
-
@Taytoo Hi Sorry i didnot see your message. I cannot remember what I have tried last time but I do remember sometimes you need to run the configure from /Src otherwise certain modules cannot be found. But this might not be the case for your Qt version. I'm not sure about Windows. I can only list the steps that worked for me fyi. I also found this tutorial quite useful. It also talks about windows and most important with troubleshootings.
For my case, Qt 5.12.0 on Ubuntu16.04.3.
- Install Qt from online installer in the standard way. Now you have your Qt in a home folder.
- Build static Qt libraries:
$ mkdir ~/qt5-static-build // where you want to put your static Qt libs $ cd ~/qt5-static-build $ mkdir build // prefer shadow build $ mkdir install // where you want to install your static Qt libs $ cd build $ ~/Qt/5.12.0/Src/configure -static -release -prefix /path-to/qt5-static-build/install -skip webengine -nomake tests -nomake examples $ make -j8 $ make install // Compiled static Qt libs will be installed /path-to/qt5-static-build/install
- Link you application to static Qt libs
$ cd app-source-code/ // Usually this is your Qt project folder $ mkdir static-build // Shadow build for your app $ cd static-build ~/qt5-static-build/install/bin/qmake -config release .. // Just make sure the qmake you used is the one we installed in Step 2 $ make
This works for me though and hope this helps. Cheeers.
-
@SGaist Hi think this topic can be closed as resolved.
-
This happened to me when I - the same as you - tried to build and install in the same directory. IOW if the
-prefix
pointed to the directory I issued theconfigure
from. After separating build and install directories the error didn't show up anymore.