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.0k Posts
  • Which version of Qt am I using? How do I find out?

    Pinned
    1
    18 Votes
    1 Posts
    23k Views
    No one has replied
  • Qt VS Tools Property Manager Qt.props file location

    Solved
    2
    0 Votes
    2 Posts
    19 Views
    PerdrixP
    Solution found, I edited the vcpkg.props file with gets loaded after Qt so that it sets the environment variable: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ImportGroup Label="PropertySheets" /> <PropertyGroup Label="UserMacros"> <VCPKG_KEEP_ENV_VARS>QTDIR</VCPKG_KEEP_ENV_VARS> <QTDIR>$(QtInstallDir)</QTDIR> </PropertyGroup> <PropertyGroup /> <ItemDefinitionGroup /> <ItemGroup> <BuildMacro Include="VCPKG_KEEP_ENV_VARS"> <Value>$(VCPKG_KEEP_ENV_VARS)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> <BuildMacro Include="QTDIR"> <Value>$(QTDIR)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> </ItemGroup> </Project>
  • I can't install Qt open source

    Moved Unsolved
    6
    0 Votes
    6 Posts
    137 Views
    jsulmJ
    @Pudying Please read what @JKSH wrote
  • Setting environment variables for vcpkg

    Unsolved
    1
    0 Votes
    1 Posts
    24 Views
    No one has replied
  • [SOLVED] Building Qt 6.9.1 for Android with ssl support.

    Unsolved
    14
    0 Votes
    14 Posts
    307 Views
    SMF-QtS
    @xalioth Thanks that is the answer I have been looking for. My current script is now as follows and seems to have worked, the build has just finished so I will now see what QtCreator makes of it. #! /bin/sh rm -r build-qt mkdir build-qt cd build-qt ../configure -prefix /opt/qt-android/ -qt-host-path /opt/qt6/ -android-abis arm64-v8a -android-sdk /opt/android/sdk/ -android-ndk /opt/android/sdk/ndk/27.2.12479018 -skip qtwebengine -openssl-linked -- -D OPENSSL_ROOT_DIR="/work/Qt-Android/android_openssl/ssl_3/arm64-v8a" exit $?
  • QMediaPlayer does not work on NixOS

    Unsolved
    10
    0 Votes
    10 Posts
    268 Views
    V
    Xeyes shows that the application is using X11. Once I'll find time, I try to force it to use Wayland.
  • Qt5-base 5.15 build fails with llvm+clang

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    W
    I have just experienced what looks like the exact same error. Even the same line number. Clang++-19, Qt5-base 5.15.17, Linux Alpine 3.22 ../../include/QtNetwork/5.15.17/QtNetwork/private/../../../../../../src/network/socket/qnet_unix_p.h:120:29: error: cannot initialize a parameter of type 'socklen_t *' (aka 'unsigned int *') with an rvalue of type 'int *' 120 | fd = ::accept4(s, addr, static_cast<QT_SOCKLEN_T *>(addrlen), sockflags); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I believe it is a result of the defines in qtplatformdefs.h, where linux clang & linux llvm are implemented with opposite logic to linux g++? (Alpine will be the default #else in both cases, because it is MUSL, not GLIBC. One will be socklen_t and the other will be the offending int. Swapping the logic to match g++ is probably a hack, but it then compiles ok on Alpine.)
  • Can qtwebglplugin be installed with aqt?

    Unsolved
    6
    0 Votes
    6 Posts
    174 Views
    KH-219DesignK
    Speaking from my own past experience with the person/team managing aqt, you can expect a helpful reply by interacting with that project here: https://github.com/miurahr/aqtinstall/issues
  • qtconsole beginner question creator 17

    Solved
    10
    0 Votes
    10 Posts
    211 Views
    J
    ok so judging by everyone's responses i realised it wasn't that the code was out of date and that creator 17 needed updated instructions, rather there was something wrong with my setup. so in case anyone else has this problem with gnome desktop environment, the culprit is gnome's default terminal app "Console". this app has a binary called kxg and i couldn't figure out what instruction to give to creator to launch it. so i installed gnome-terminal and made this the default terminal app. under environment variables in the manage kits section, the terminal command is gnome-terminal -x. this seems to have solved the problem. thanks to everyone who replied. it set me in the right direction!
  • .exe file is not opening

    Solved
    28
    0 Votes
    28 Posts
    5k Views
    jsulmJ
    @Puneeth_BR Deploy your app properly first. See https://doc.qt.io/qt-6/deployment.html
  • App bundle not work after executing macdeployqt

    Unsolved
    8
    0 Votes
    8 Posts
    205 Views
    SGaistS
    AFAIK, no, you don't need a company account unless you are working for a company for that application.
  • "AllUsers" not working if set programmatically in QtIFW

    Unsolved
    6
    0 Votes
    6 Posts
    145 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
    231 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
    84 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
    447 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
    102 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
    186 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
    318 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
    148 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