Skip to content

Installation and Deployment

Your Qt just doesn't want to build? Your compiler can't find the libs? Here's where you find comfort and understanding. And help.
9.7k Topics 51.1k Posts
  • "AllUsers" not working if set programmatically in QtIFW

    Unsolved
    6
    0 Votes
    6 Posts
    229 Views
    JonBJ
    @Flinco That was indeed the kind of thing I was suggesting. For unknown reason it appears that the if in if (m_variables.value(QLatin1String("AllUsers")) == scTrue) { desktop = system.value(QLatin1String("Common Desktop")).toString(); } else { desktop = user.value(QLatin1String("Desktop")).toString(); } reacts as desired when you pass AllUsers=true on command line but not when function Controller() { installer.setValue("AllUsers", "true"); } Perhaps this is "too late" (or even "too early") for the call to addDynamicPredefinedVariables(). Your new code/this "workaround" does the code for the choice of system.value(QLatin1String("Common Desktop")) unconditionally without relying on m_variables.value(QLatin1String("AllUsers")) == scTrue (btw, I do not know whether setValue("AllUsers", "true") actually sets a value which equals scTrue).
  • Unexpected result of CMake Install

    Unsolved
    4
    0 Votes
    4 Posts
    253 Views
    FeRDNYCF
    I don't do much development on macOS, but AIUI the reason the deploy tool is run on the files in the build dir is that you're not expected to install them. (Not using CMake, anyway.) If you look at the docs on macOS deployment using CMake, they say: To build for Apple platforms you need to set cmake_minimum_required() to 3.21.1 or newer: cmake_minimum_required(VERSION 3.21.1) Go into the directory that contains the application: cd /path/to/Qt/examples/widgets/tools/plugandpaint/app Next, set the CMAKE_PREFIX_PATH variable to point to your installation prefix. If you have a Cmake build already, delete the CMakeCache.txt file. Then, rerun CMake: cmake -DCMAKE_PREFIX_PATH=path/to/Qt/6.9.1/your_platform -S <source-dir> -B <build-dir> -G Ninja Alternatively, use the convenience script qt-cmake, which sets the CMAKE_PREFIX_PATH variable for you. path/to/Qt/6.9.1/your_platform/bin/qt-cmake -S <source-dir> -B <build-dir> -G Ninja Finally, go into your build directory and run your preferred build system. In this example, we're using Ninja. cd path/to/build/dir ninja Now, provided that everything compiled and linked without any errors, you should have a plugandpaint.app bundle ready for deployment. Try installing the bundle on a machine running macOS that does not have Qt or any Qt applications installed. So, the application bundle in the build directory is the one processed by macdeployqt (which you can see is the case in your own CMake output as well), on the assumption that after it's been made self-contained and code-signed, it's ready for deployment using standard macOS means (.dmg files and drag-and-drop installation). Update I've decided I'm wrong about some of this, because the deployment tools only run on install(). Qt's CMake deployment docs mention, for Qt Quick applications: You install the application as before. install(TARGETS MyApp BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) To generate the deployment script, you call qt_generate_deploy_qml_app_script() instead of qt_generate_deploy_app_script(). qt_generate_deploy_qml_app_script( TARGET MyApp OUTPUT_SCRIPT deploy_script ) install(SCRIPT ${deploy_script}) On installation, the application binary will be deployed, including the QML files and the shared libraries and assets of Qt that are used by the project. Again, the resulting directory is self-contained and can be packaged by tools like cpack. It might be worth looking at the generated cmake_install.cmake in the bundle's build directory, to see what it's doing? That file will be created immediately after configuration, you don't even need to run the build to examine it.
  • 0 Votes
    1 Posts
    95 Views
    No one has replied
  • Building QT6 from Source failed (qtbase printsupport_autogen\timestamp)

    Unsolved
    19
    0 Votes
    19 Posts
    3k Views
    A
    I know this is an old post, but I figured I'd add this information as I ran into it. I don't think it is related to autogen or timestamps, I believe it is related to precompiled header files in general, because some of the failures I ran into had nothing to do with autogen, even thought some of them did: /Fdqtbase\src\openglwidgets\CMakeFiles\OpenGLWidgets.dir\ /FS -c qtbase\src\openglwidgets\CMakeFiles\OpenGLWidgets.dir\cmake_pch.cxx Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30153 for x64 Copyright (C) Microsoft Corporation. All rights reserved. ninja: build stopped: subcommand failed. 11:55:53 [836/4092] Building CXX object qtlanguageserver\src\jsonrpc\CMakeFiles\JsonRpcPrivate.dir\cmake_pch.cxx.obj 11:55:53 [837/4092] Building CXX object qtgrpc\src\protobuf\CMakeFiles\Protobuf.dir\cmake_pch.cxx.obj 11:55:53 [838/4092] Building CXX object qtserialport\src\serialport\CMakeFiles\SerialPort.dir\cmake_pch.cxx.obj 11:55:53 [839/4092] Building CXX object qtconnectivity\src\nfc\CMakeFiles\Nfc.dir\cmake_pch.cxx.obj 11:55:53 ninja: build stopped: subcommand failed. I was able to work-around it by disabling precompiled headers files by adding -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON to the CMake generation step. I was using the CMake with Visual Studio 2019 ( 3.20.21032501-MSVC_2) on Qt 6.7.3.
  • Qt VSTools versus CMake build

    Unsolved
    9
    0 Votes
    9 Posts
    547 Views
    S
    @Axel-Spoerl said in Qt VSTools versus CMake build: Is the cmake-gui any good? Just like git, I always found the command line easier to use.... So far, I have never really learned CMake in depth. I have run into problems with CMake on the command line when reconfiguring with different options (because you forgot one). The cmake-gui (and also ccmake on the command line) seem to do the correct thing in the background. Especially on Windows, the default of the cmake-gui is to generate a VS project (there is even a button to directly open the project from the cmake-gui). For someone without any knowledge of CMake this is a much better starting point (especially for 3rd-party libraries) than using the command line. One advantage of cmake-gui and ccmake is that you see all the different options that you can change. By default you only see the options of the project's CMakeList.txt, but you can toggle the advanced mode to see all CMake options as well.
  • Force Open Source Installation

    Moved Unsolved
    2
    0 Votes
    2 Posts
    129 Views
    JKSHJ
    Hi @studious-serpent, and welcome! Is there a way that I can force the tool to install the open source version? You'll need to log in with a different email address unfortunately.
  • Noob looking for help with PySide6 segmentation fault core dump

    Solved
    5
    0 Votes
    5 Posts
    241 Views
    dweldenD
    @jsulm Thank you, that seems to have resolved my issue.
  • Failed to distribute applications in a MSYS2 environment

    Unsolved distribution msys2
    8
    0 Votes
    8 Posts
    421 Views
    jsulmJ
    @Grit-Clef I mean to check the access rights for the DLLs where you get "could not be found" ("but those dlls are there...").
  • Set up Qtcreator for cross-compiling Linux host to Windows 10 and 11 targets

    Unsolved
    2
    0 Votes
    2 Posts
    160 Views
    Axel SpoerlA
    /usr/bin/c++ is the local compiler on Linux, not the cross-compiler, which on my system is x86_64-w64-mingw32-g++. That means, something in the configure step went wrong or the toolchain hasn't been installed correctly. See here for more info: https://doc.qt.io/qtvstools/qtvstools-how-to-cross-compile.html
  • CMake windeployqt not deplying .pdb files for executables

    Solved
    3
    0 Votes
    3 Posts
    170 Views
    PerdrixP
    So it won't copy the pdb files from my build dir to the deploy dir - OK understood - though I think it should!
  • Can't notarize Qt frameworks

    Unsolved
    2
    0 Votes
    2 Posts
    157 Views
    SGaistS
    Hi, How are you doing the notarization ?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Cannot run Qt Online Installer on Red Hat UBI 9, libxkbcommon-x11.so.0 missing

    Unsolved
    5
    0 Votes
    5 Posts
    321 Views
    JKSHJ
    @ZergedU said in Cannot run Qt Online Installer on Red Hat UBI 9, libxkbcommon-x11.so.0 missing: It looks like Red Hat UBI 9 strips down the AppStream repo from the RHEL version. Notably, the package "libxkbcommon-x11" is missing. Ah... that's a shame. I guess you'll need to resort to a 3rd-party repo then? (Or build it from source)
  • servers

    Unsolved
    2
    0 Votes
    2 Posts
    154 Views
    JKSHJ
    Hi @nazim, and welcome! The service provider was down for several hours: https://www.bleepingcomputer.com/news/technology/massive-heroku-outage-impacts-web-platforms-worldwide/ It is back online now, and you should be able to log in again.
  • cannot install Qt installer tool on Ubuntu 22.04

    Unsolved
    2
    0 Votes
    2 Posts
    137 Views
    JKSHJ
    Hi @montanaviking, open your downloaded file with a text editor. You'll see that curl has saved a HTML document, not an executable. Either use a web browser to download it, or ask curl to follow redirects.
  • MaintanenceTool An internal server error occurred

    Solved
    3
    0 Votes
    3 Posts
    264 Views
    F
    Ah, ok, thx.
  • Problem with adding executable to macOS bundle

    Unsolved
    2
    0 Votes
    2 Posts
    199 Views
    PerdrixP
    I tried this: if(NOT LINUX) set (deploy_tool_options_arg "-verbose=1") if(APPLE) set(deploy_tool_options_arg "${deploy_tool_options_arg} -hardened-runtime -timestamp -no-strip") set(deploy_tool_options_arg "${deploy_tool_options_arg} \"-executable=$<TARGET_BUNDLE_CONTENT_DIR:DeepSkyStacker>/MacOS/DeepSkyStackerCL\"") set(deploy_tool_options_arg "${deploy_tool_options_arg} \"-executable=$<TARGET_BUNDLE_CONTENT_DIR:DeepSkyStacker>/MacOS/uchmviewer\"") set(deploy_tool_options_arg "${deploy_tool_options_arg} \"-codesign=Developer ID Application: David Partridge (VH8AYT3C7Y)\"") and it seems to have worked ... Was that the best way to do it?
  • How to distribute Qt based libraries?

    Unsolved
    1
    0 Votes
    1 Posts
    114 Views
    No one has replied
  • windeployqt6.exe in Qt 6.7.2 does not deploy some gcc libs

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    M
    Same problem here with Qt 6.9.1: libunwind.dll and libc++.dll are missing. I believe it worked previously with Qt 6.8.0. And again, copying those files from C:\Qt\6.9.1\llvm-mingw_64\bin fixes it. Is it broken again or did I make a mistake?
  • 0 Votes
    3 Posts
    6k Views
    N
    @M4Z4 Hi, I'm not 100% sure I follow your launching process, but the error you're getting looks a lot like you are not setting the wayland display export in the same terminal as you run the QT application. Specifically, this part of the error message: Jan 13 11:55:32 sm2s-imx8mp cpx.sh[1628]: qt.core.plugin.factoryloader: Got keys from plugin meta data QList("wayland-egl") Jan 13 11:55:32 sm2s-imx8mp cpx.sh[1628]: qt.core.plugin.factoryloader: checking directory path "/opt/cpx/platforms" ... Jan 13 11:55:32 sm2s-imx8mp cpx.sh[1628]: qt.core.library: "/usr/lib/plugins/platforms/libqwayland-egl.so" loaded library Jan 13 11:55:32 sm2s-imx8mp cpx.sh[1628]: Failed to create wl_display (Connection refused) Jan 13 11:55:32 sm2s-imx8mp cpx.sh[1628]: EGL: Warning: No default display support on wayland Jan 13 11:55:32 sm2s-imx8mp cpx.sh[1628]: qt.qpa.wayland: EGL not available Jan 13 11:55:32 sm2s-imx8mp cpx.sh[1628]: qt.qpa.plugin: Could not load the Qt platform plugin "wayland-egl" in "" even though it was found. The connection to the display screen is refused. It looks like either 1) Your path to the wayland display is wrong (check ls -l ${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY} before running your QT application) or 2) the user running QT does not have permissions. You should be able to see test applications like weston-flower work as well