Hello. I am trying to build Qt5 static but its failed because of missing executables.
PS D:\vcpkg\vcpkg> .\vcpkg install qt5-tools:x64-windows-static
The following packages will be built and installed:
* qt5-declarative[core]:x64-windows-static
qt5-tools[core]:x64-windows-static
Additional packages (*) will be modified to complete this operation.
Starting package 1/2: qt5-declarative:x64-windows-static
Building package qt5-declarative[core]:x64-windows-static...
-- Using cached D:/vcpkg/vcpkg/downloads/qtdeclarative-everywhere-src-5.11.1.tar.xz
-- Using source at D:/vcpkg/vcpkg/buildtrees/qt5-declarative/src/5.11.1-f24c2c5092
-- Configuring x64-windows-static-rel
-- Configuring x64-windows-static-rel done
-- Configuring x64-windows-static-dbg
-- Configuring x64-windows-static-dbg done
-- Package makefiles-x64-windows-static-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:56 (message):
Command failed: D:/vcpkg/vcpkg/downloads/tools/jom/jom-1.1.2/jom.exe;qmake_all
Working Directory: D:/vcpkg/vcpkg/buildtrees/qt5-declarative/x64-windows-static-dbg
See logs for more information:
D:\vcpkg\vcpkg\buildtrees\qt5-declarative\package-makefiles-x64-windows-static-dbg-out.log
D:\vcpkg\vcpkg\buildtrees\qt5-declarative\package-makefiles-x64-windows-static-dbg-err.log
Call Stack (most recent call first):
scripts/cmake/vcpkg_build_qmake.cmake:31 (vcpkg_execute_required_process)
scripts/cmake/vcpkg_build_qmake.cmake:45 (run_jom)
installed/x64-windows-static/share/qt5modularscripts/qt_modular_library.cmake:47 (vcpkg_build_qmake)
ports/qt5-declarative/portfile.cmake:5 (qt_modular_library)
scripts/ports.cmake:71 (include)
Looks like build script cant find some executables. Here is an error.log:
jom 1.1.2 - empower your cores
'D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\bin\qmlimportscanner.exe' is not recognized as an internal or external command,
operable program or batch file.
D:/vcpkg/vcpkg/installed/x64-windows-static/share/qt5/debug/mkspecs/features/qt.prf:312: Error parsing JSON at 1:1: illegal value
Project ERROR: Failed to parse qmlimportscanner output.
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\Makefile [sub-qml-qmake_all] Error 3
'D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\bin\qmlimportscanner.exe' is not recognized as an internal or external command,
operable program or batch file.
D:/vcpkg/vcpkg/installed/x64-windows-static/share/qt5/debug/mkspecs/features/qt.prf:312: Error parsing JSON at 1:1: illegal value
Project ERROR: Failed to parse qmlimportscanner output.
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\Makefile [sub-qmleasing-qmake_all] Error 3
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\Makefile [sub-tools-qmake_all] Error 2
I tried dirty trick - put those binaries qml.exe, qmlcachegen.exe, qmleasing.exe, qmlimportscanner.exe, qmllint.exe, qmlmin.exe, qmlplugindump.exe, qmlprofiler.exe, qmlscene.exe, qmltestrunner.exe from dynamic build in a build time. But I stuck with another errors:
jom 1.1.2 - empower your cores
The system cannot find the path specified.
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\qmlmin\Makefile.Debug [..\..\bin\qmlmin.exe] Error 1
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\qmlmin\Makefile [debug] Error 2
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\Makefile [sub-qmlmin-make_first] Error 2
The system cannot find the path specified.
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\qmllint\Makefile.Debug [..\..\bin\qmllint.exe] Error 1
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\qmllint\Makefile [debug] Error 2
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\Makefile [sub-qmllint-make_first] Error 2
The system cannot find the path specified.
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\qmlimportscanner\Makefile.Debug [..\..\bin\qmlimportscanner.exe] Error 1
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\qmlimportscanner\Makefile [debug] Error 2
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\Makefile [sub-qmlimportscanner-make_first] Error 2
The system cannot find the path specified.
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\qmlcachegen\Makefile.Debug [..\..\bin\qmlcachegen.exe] Error 1
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\qmlcachegen\Makefile [debug] Error 2
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\tools\Makefile [sub-qmlcachegen-make_first] Error 2
jom: D:\vcpkg\vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\Makefile [sub-tools-make_first] Error 2
UPD:
PS D:\vcpkg\vcpkg> .\vcpkg version
Vcpkg package management program version 2018.10.20-nohash
I had this same issue just now. I ended up installing it like this:
.\vcpkg.exe install qt5-declarative --triplet x64-windows
This tells me either a configuration doesn't exist for a "static" build, or the package was never meant to be built as static. If it's the latter, they should probably put a check or some type of logic to say, "regardless of how qt5 gets installed, if there are certain parts that can't be static, force them to be dynamic. Otherwise, if you attempt to build Qt 5 as static, this will happen. If Qt 5 shouldn't be built that way, they should probably force the option to build as dynamic or handle it in some other way.
I have been trying to compile qt5 static with shared crt.
I got the modules I needed to compile but qt5 declarative is causing me problems.
After configuration, it turns out that a few of the projects in qt5 declarative are using the LIBAPP and LIBFLAGS macros to build their project but LIBAPP and LIBFLAGS are not defined.
LIBFLAGS is effectively LFLAGS and LIBS together and LIBAPP can be LINKER or it can be 'lib' application.
For the first module I came across (sorry cann't remember its name right now), I wrote a quick and dirty fix in python that finds every Makefile.Debug and Makefile.Release and
adds definitions to these makefiles for LIBAPP and LIBFLAGS and that fixed it.
But the build order in qt5 declarative is different and the fix fails to address the issue. I been trying to go through the qt configuration files trying to find the place LIBAPP is defined in the generation of the Makefile to know available. My hope is to define this variable properly but I can't find it in the files.
Would someone have a suggestion about how I can define LIBAPP &/or LIBFLAGS ?
Thanks.
I believe I have figured out that "LIBAPP" and "LIBFLAGS" are part of the qmake code. They are defined in winmakefile.cpp and msvc_nmake.cpp in qtbaseqmakegeneratorswin32 and they are only used in a static build.
But for some reason on a static build, the resulting makefiles that generated for the qt5-declarativetools use LIBAPP and LIBFLAGS to build the applications but the definitions do not exist.
Any idea why?
I battled this for a few days as well and got bogged down in the vcpkg scripts->qmake (spiral...spiral)->nmake before giving up.
Prior to this I was eventually able to build a static x64 version of Qt from source using:
..\Qtv5.9.7_src\configure -developer-build -confirm-license -debug-and-release -opensource -platform win32-msvc -opengl desktop -no-shared -static -no-static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -ltcg -make libs -make tools -nomake examples -no-compile-examples -no-dbus -no-qml-debug -no-icu -no-gtk -no-opengles3 -no-angle -no-sql-sqlite -no-sql-odbc -no-sqlite -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -nomake tests
That worked for me but I generally prefer the vcpkg deployment approach so had a try at fixing this, no joy. Anotheralternative is to download the prebuilt binaries from https://github.com/martinrotter/qt5-minimalistic-builds.
Thanks
On Feb 21, 2019, at 4:11 PM, Aaron Clauson notifications@github.com wrote:
I battled this for a few days as well and got bogged down in the vcpkg scripts->qmake (spiral...spiral)->nmake before giving up.
Prior to this I was eventually able to build a static x64 version of Qt from source using:
..Qtv5.9.7_srcconfigure -developer-build -confirm-license -debug-and-release -opensource -platform win32-msvc -opengl desktop -no-shared -static -no-static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -ltcg -make libs -make tools -nomake examples -no-compile-examples -no-dbus -no-qml-debug -no-icu -no-gtk -no-opengles3 -no-angle -no-sql-sqlite -no-sql-odbc -no-sqlite -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -nomake tests
That worked for me but I generally prefer the vcpkg deployment approach so had a try at fixing this, no joy. Anotheralternative is to download the prebuilt binaries from https://github.com/martinrotter/qt5-minimalistic-builds.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
I can confirm building/installing qt-declarative with x64-windows works fine, while building with x64-windows-static does not.
The error log shows:
vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\bin\qmlimportscanner.exe' is not recognized as an internal or external command,
operable program or batch file.
Comparing the buildtree bin folders vcpkg\buildtrees\qt5-declarative\x64-windows-dbg\bin\ and vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\bin\ the first is filled with binaries, while the second is completely empty.
Checking the Makefile at vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\Makefile documents the qmake call that was used:
# Command: …\vcpkg\installed\x64-windows-static\tools\qt5\qmake.exe -o Makefile …\vcpkg\buildtrees\qt5-declarative\src\5.12.1-1f64885d6f\qtdeclarative.pro "CONFIG-=release" "CONFIG+=debug" "CONFIG+=staticlib" -qtconf …/vcpkg/buildtrees/qt5-declarative/x64-windows-static-dbg/qt.conf
To me the CONFIG value staticlib looks like it could be wrong. I guess this should be simply static instead?
Where does this come from exactly? The ports file is trivial. Where would I have to check?
Unfortunately manually building in that folder with adequate qmake file did not succeed - although it did produce two files in the bin folder before failing (to link the qmllint.exe). The command there looks like it used the staticlib CONFIG value still though, so this is probably an incomplete change and thus fails to build.
Does the CONFIG+=staticlib declaration come from the vcpkg triplet configuration, cmake, or Qt?
Duplicate with #6240 #5881 #731 #513.
@Kissaki It seems that the option staticlib is not supported on the latest version. I checked out the official static build script(documentation) and I tried to replace it with static, and this seems to work.
Hi @VladBolotov, thanks for reporting this issue.
Since qt has been upgrade to 5.12.4, we fixed this issue. Please update vcpkg and rebuild qt5-declarative.
Thanks.
@JackBoosY
Error: Building package qt5-declarative:x86-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: qt5-declarative:x86-windows-static
Vcpkg version: 2020.06.15-nohash
@96chh Can you open a new issue to report that?
Thanks.
Most helpful comment
I can confirm building/installing
qt-declarativewithx64-windowsworks fine, while building withx64-windows-staticdoes not.The error log shows:
Comparing the buildtree bin folders
vcpkg\buildtrees\qt5-declarative\x64-windows-dbg\bin\andvcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\bin\the first is filled with binaries, while the second is completely empty.Checking the Makefile at
vcpkg\buildtrees\qt5-declarative\x64-windows-static-dbg\Makefiledocuments the qmake call that was used:To me the
CONFIGvaluestaticliblooks like it could be wrong. I guess this should be simplystaticinstead?Where does this come from exactly? The ports file is trivial. Where would I have to check?
Unfortunately manually building in that folder with adequate qmake file did not succeed - although it did produce two files in the bin folder before failing (to link the qmllint.exe). The command there looks like it used the staticlib CONFIG value still though, so this is probably an incomplete change and thus fails to build.
Does the
CONFIG+=staticlibdeclaration come from the vcpkg triplet configuration, cmake, or Qt?