Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. static build
    Log in to post

    • UNSOLVED Compile using static Qt build with QtCreator - not using static OS libraries
      Tools • qtcreator static build os libraries • • montanaviking  

      7
      0
      Votes
      7
      Posts
      97
      Views

      Thanks, I am distributing my source code via GitHub and GPL. I think that so long as I do that, it doesn't matter whether or not I use static linking in so far as licensing is concerned. My code is open-source, at least that's my intent. I did find that I was able to easily modify the makefile emitted by Qt Creator to force static linking of most, but not all of the Linux system dependencies. Apparently, some of the OS libraries were available only as shared libraries and in some cases Qt libraries called shared Linux OS libraries so that I was not able to use all the available static libraries offered by Linux. Too bad that it doesn't appear that one can roll up a desktop app all into one executable with no shared library calls. I'm thinking this would be nice since then, it could be distributed to any Linux machine without consideration of the distribution or kernel version? Thanks, Phil
    • UNSOLVED Undef. ref. __emutls on Qt 5.15.1 static Windows
      General and Desktop • static build • • MikePooh  

      1
      0
      Votes
      1
      Posts
      17
      Views

      No one has replied

    • UNSOLVED Undefined references in Qt5.14.0 static using CMake (mingw) in Windows
      General and Desktop • static build • • MNB_1101  

      5
      0
      Votes
      5
      Posts
      210
      Views

      I searched for this problem a lot and found the problem in the link below, which is related to a bug in version Qt5.14.0 that has been fixed in higher versions. I tested with version Qt5.14.2 and it was compiled without error. https://stackoverflow.com/questions/41765673/static-linking-against-qt-on-windows-using-cmake https://codereview.qt-project.org/c/qt/qtbase/+/282408
    • UNSOLVED how to statically compile Qt using MinGW compiler and SSL support
      Installation and Deployment • qmake openssl static build ssl qt 5 • • CybeX  

      1
      0
      Votes
      1
      Posts
      156
      Views

      No one has replied

    • UNSOLVED QtQuick 2 controls aren't visible in QML-designer after Qt static building
      QML and Qt Quick • qml qtquick2 qt designer static build design mode • • HoShiMin  

      1
      0
      Votes
      1
      Posts
      69
      Views

      No one has replied

    • UNSOLVED QT 5.13.0 Static Commercial Build - Requiring D3D12.dll?
      General and Desktop • static build commercial directx • • FuzzeWuzze  

      2
      0
      Votes
      2
      Posts
      126
      Views

      Hi, Since you have a commercial licence, I would recommend opening an issue directly from your account as you have access to support.
    • SOLVED Does QT configuration tool help in optimizing application size ?
      Tools • configure static build configuration configure tool • • Srinivasan  

      5
      0
      Votes
      5
      Posts
      900
      Views

      @sierdzio Thank you. Will look into it.
    • UNSOLVED "Mismatch detected for RuntimeLibrary" when trying to statically compile with a static build of Qt
      Installation and Deployment • static build msvc2017 • • EinderJam  

      3
      0
      Votes
      3
      Posts
      759
      Views

      @EinderJam said in "Mismatch detected for RuntimeLibrary" when trying to statically compile with a static build of Qt: Before building, using this tutorial, I modified qt-everywhere-src-5.11.1\qtbase\mkspecs\msvc-desktop.conf and replaced every -MD by -MT Build process went fine. If you changed the Qt compilation flags at some point, did you clean out absolutely everything before rebuilding? Many times it seems bits get left over which have been compiled with previous flags.
    • SOLVED Qt Static Build Configuration
      General and Desktop • static static build msvc2015 nmake 5.10.1 • • ed-wright  

      4
      0
      Votes
      4
      Posts
      457
      Views

      @ed-wright Not sure, but probably you have to do a "nmake distclean" in between or it finds your license information. However, this is the opensource forum. You would need to approach the commercial, they have to able to give the proper answer.
    • SOLVED Static Builds not Working
      General and Desktop • static static build msvc2015 nmake 5.10.1 • • ed-wright  

      19
      0
      Votes
      19
      Posts
      4855
      Views

      Super good work. Thanks for updating on the way. will be helpful for others.
    • UNSOLVED Building QT from source code statically to be used with Visual Studio
      Installation and Deployment • visual studio deployment static build visual c++ x64 • • onat  

      2
      0
      Votes
      2
      Posts
      822
      Views

      Hi, Use the amd64 command prompt when building Qt.
    • UNSOLVED Runtime error: “must construct a QApplication before a QWidget” when launching a QDialog from a dll built with static Qt
      General and Desktop • qwidget dll static build qapplication static linking • • awyarbr  

      2
      0
      Votes
      2
      Posts
      870
      Views

      Hi and welcome to devnet, Do you have any static QWidget based class in your library/application ?
    • SOLVED Qt Build 5.9.1 Static with OCI Driver
      General and Desktop • static build driver build error static qt oci • • Slane  

      10
      0
      Votes
      10
      Posts
      3267
      Views

      I made several modifications ... but i think the properly modifications are In : QtSrc\qtbase\mkspecs\win32-g++\qmake.conf add QMAKE_LFLAGS += -static -static-libgcc QMAKE_CFLAGS_RELEASE -= -O2 QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer DEFINES += QT_STATIC_BUILD In : QtSrc\qtbase\src\plugins\sqldrivers\oci\oci.pro add QMAKE_LFLAGS += oracle_home\oci\lib\msvc\oci.lib QMAKE_LFLAGS += oracle_home\oci\lib\msvc\ociw32.lib QMAKE_LFLAGS += oracle_home\oci\lib\msvc\oraocci11.lib LIBS += -Loracle_home\oci\lib\msvc -loci -lociw32 -loraocci11 INCLUDEPATH += oracle_home\oci\include cmd -static -debug-and-release -platform win32-g++ -prefix QtPath\Static -I C:\\OpenSSL-Win32\\include -L C:\\OpenSSL-Win32\\lib -opensource -confirm-license -c++std c++14 -nomake examples -skip qtdoc -skip wayland -skip purchasing -skip serialbus -skip qtserialport -skip script -skip scxml -skip speech -skip location -no-opengl -no-angle -qt-zlib -qt-pcre -qt-libpng -no-libjpeg -qt-freetype -sql-oci -I oracle_home\oci\include -L oracle_home\oci\lib\msvc try it. the other modifications do not matter
    • SOLVED Qt Static Compile Linux - Error Loading libxcb-xinerama.so
      General and Desktop • linux static build g++ • • ScottLupton  

      7
      0
      Votes
      7
      Posts
      3644
      Views

      No issue in using it. The only thing to take into account is that any update to the Qt provided xcb library won't happen until next release of Qt (unless you're building from the latest git revision) while your system xcb will follow your distribution updates. That's a tradeoff that only you can decide upon.
    • Apply Enterprise License to Static QT
      Installation and Deployment • static build license • • jordanbaucke  

      5
      0
      Votes
      5
      Posts
      1036
      Views

      @jordanbaucke Sure, since you have commercial license you can bring the point directly to support.
    • UNSOLVED Static build - size of exe too big
      General and Desktop • static build size exe • • christos.alewa  

      11
      0
      Votes
      11
      Posts
      5205
      Views

      You could certainly make use of UPX, it should get the filesize down to maybe 4MB (by using compression).
    • UNSOLVED QtWebEngine - static
      General and Desktop • visual studio qtwebengine static build • • Soeren  

      5
      0
      Votes
      5
      Posts
      2962
      Views

      Thanks. I take a look at hat and at http://tishion.github.io/QCefView/ But then we end up in using an extra lib. Something we want to avoid.... :-(
    • SOLVED Why Qt needs to be configured with static parameter to create static build programs
      Installation and Deployment • static build static conf • • KCaglarCoskun  

      2
      0
      Votes
      2
      Posts
      782
      Views

      Hi and welcome to devnet, If you want a full static application then you have to also build all dependencies as static and since you're on Windows, you also have to take into account the Visual Studio Runtime (since you are using a Visual Studio Qt build). Note that this is nothing Qt specific. No, you don't have to delete anything, you can use several builds of Qt in parallel without any problem. How fast your build time will be depends on the machine you have. Developing applications and the type of builds are two completely unrelated topics. Note that using a static build of Qt has licensing implications.
    • SOLVED Unable to link Qt application statically
      Installation and Deployment • qt5.5 arm static build plugins static linking • • zappy  

      9
      0
      Votes
      9
      Posts
      5808
      Views

      Okay... finally i solved it. Nothing to do with .pro file or PLUGIN macro. It was a basic PATH issue. qmake was searching for 'plugin' directory in /PREFIX path not in /SYSROOT/PREFIX path. I just copied all plugin directory from /SYSROOT/PREFIX to /PREFIX directory. I know this may not be the right way, but it temporarily solved my issue. If someone could suggest the correct solution please let me know.
    • SOLVED Qt 5.6 Linux compile fails
      General and Desktop • static build qt 5.6 linux mint • • Jedd  

      3
      0
      Votes
      3
      Posts
      1500
      Views

      Thatt did the trick, thanks!
    • SOLVED Building Static Qt
      General and Desktop • static build • • shahriar25  

      10
      0
      Votes
      10
      Posts
      3770
      Views

      As long as you abide by the GPL, you're good.
    • UNSOLVED How do I install Crypto++ in Qt Visual Studio 2010 Windows 7?
      General and Desktop • static build msvc crypto encrypt qt 4.7.4 • • Narthan  

      6
      0
      Votes
      6
      Posts
      1730
      Views

      You have a list of examples here
    • UNSOLVED Building/Running static plugin?
      Installation and Deployment • plugin static static build • • RyanB  

      2
      0
      Votes
      2
      Posts
      1309
      Views

      use macro: Q_IMPORT_PLUGIN(QLinuxFbIntegrationPlugin);
    • SOLVED Qt 5.5.1 OS X 10.11 Static linkage Qt Multimedia
      Installation and Deployment • qtmultimedia static build mac os • • Ivan Kolesnikov  

      21
      0
      Votes
      21
      Posts
      6941
      Views

      I updated a .pro file to the following state: QT += core multimedia widgets QT -= gui TARGET = MetadataExtractor CONFIG += console CONFIG += static TEMPLATE = app SOURCES += main.cpp extractor.cpp HEADERS += extractor.h Then used the macdeployqt. This issue is resolved for me. @SGaist @Tyras @kshegunov Thanks to Everyone!
    • UNSOLVED QtWebKit compiling errors
      General and Desktop • qt5 windows static build qtwebkit compile • • sp00lin9  

      3
      0
      Votes
      3
      Posts
      1848
      Views

      @Konstantin-Tokarev yes it is, i was thinking of trying an older version of ruby as i just grabbed the newest one..
    • UNSOLVED Custom static build fails on plugins
      General and Desktop • static build plugins 5.5.1 imageformats • • EMStegehuis  

      1
      0
      Votes
      1
      Posts
      559
      Views

      No one has replied

    • UNSOLVED Strange behaviour of a program built with a static Qt
      Installation and Deployment • static build ubuntu 15.10 • • mchome  

      4
      0
      Votes
      4
      Posts
      1215
      Views

      Having a static Qt doesn't mean that all dependencies are gone. Qt might be static but unless you also link to the static version of all its dependencies, what you have is normal: OpenGL and the xcb plugin deps.
    • UNSOLVED Building static version
      General and Desktop • static build • • gabor53  

      3
      0
      Votes
      3
      Posts
      628
      Views

      Use this. My Problem was solved by following that mentioned steps. Before you start, read the comments below.
    • UNSOLVED "undefined reference to 'qt_static_plugin_AccessibleFactory()'" for static Qt build during exe build
      General and Desktop • static build plugins static library • • pditty8811  

      3
      0
      Votes
      3
      Posts
      1273
      Views

      Does anyone have instructions for Qt static build that is version 5.4 or greater?
    • [Solved] Biologist using a Qt built program - how can I run it??
      General and Desktop • build static build run • • Skeffington  

      6
      0
      Votes
      6
      Posts
      1822
      Views

      @Skeffington Cheers :)
    • OCI driver in static build[solved]
      General and Desktop • qt5.5 static build oci • • Giorgi  

      7
      0
      Votes
      7
      Posts
      2454
      Views

      The XXX was meant to be replaced with whatever sql plugin you wanted to have built-in Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)
    • Translation of QDialogButtonBox in statically build app
      General and Desktop • qt5 static build translation • • Radim  

      6
      0
      Votes
      6
      Posts
      2030
      Views

      Finally I'm able to automatically copy the qt translation files and create resource file from the pro file: TRANSLATIONS = myapp_cs.ts \ myapp_xx.ts QT_TRANSLATIONS = qtbase_cs.qm #------------------------------------------------- # create lang folder QM_DIR = $$shadowed($${PWD})/lang mkpath($${QM_DIR}) mkpath($${QM_DIR}/lang) #------------------------------------------------- # copy system translation files to lang folder for(FILE,QT_TRANSLATIONS){ FILE = $$shell_path($$[QT_INSTALL_TRANSLATIONS]/$${FILE}) system($${QMAKE_COPY} $${FILE} $$shell_path($${QM_DIR}/lang)) } #------------------------------------------------- #generate qm files directly from qmake for(FILE,TRANSLATIONS){ QM_FILE = $$shell_path($${QM_DIR}/lang/$$replace(FILE,.ts,.qm)) system(lrelease $${FILE} -qm $${QM_FILE}) } #------------------------------------------------- #create resource file with translations win32:system(cd $$shell_path($${QM_DIR}) & rcc --project -o lang.qrc) unix:system(cd $$shell_path($${QM_DIR}) ; rcc --project -o lang.qrc) RESOURCES += $${QM_DIR}/lang.qrc #------------------------------------------------- # extra target to generate ts translation files lupdate.commands = lupdate $$_PRO_FILE_ lupdate.depends = FORCE QMAKE_EXTRA_TARGETS += lupdate #------------------------------------------------- # extra compiler to generate qm translation files lrelease.input = TRANSLATIONS lrelease.output = $${QM_DIR}/lang/${QMAKE_FILE_BASE}.qm lrelease.commands = lrelease ${QMAKE_FILE_NAME} -qm ${QMAKE_FILE_OUT} lrelease.CONFIG += no_link target_predeps QMAKE_EXTRA_COMPILERS += lrelease
    • ANGLE with static 5.5 build
      General and Desktop • qt 5.5 static static build opengl es angle • • dbrunner  

      2
      0
      Votes
      2
      Posts
      1395
      Views

      Another interesting development: I tried running on another machine with the Qt toolchain installed, and the program worked. So it appears it is still reading something from the filesystem that is not on a regular Windows machine, but I don't know what that might be. I did package all the qmldir files needed for Qt Quick to work.
    • Error encountered while doing a static build of a Qt application
      General and Desktop • static build mingw32 5.2.1 • • Connie  

      2
      0
      Votes
      2
      Posts
      956
      Views

      I have a similar issue as well. some error while compiling. although instead of undefined reference to i am getting something like deprecated function. No idea whats the problem. Thanks Scot V Development Team Fastest Web Browser
    • Unable to run Application compiled by QT creator in other windows machine
      Installation and Deployment • installation static build compilation • • jitu059_Lalat  

      2
      0
      Votes
      2
      Posts
      970
      Views

      @jitu059_Lalat The long and short if it are, you have two ways to do this: Find all the dll's that your app depends on. You can do this with the tool http://www.dependencywalker.com/. Once you found all the dll's copy them into the same folder as your executable. This is now your "delivery package" you will copy the executable + dlls from PC to PC. This method is perhaps a bit easier/faster in the short term, but when you compile with different versions of Qt/Windows you may require a different set of dlls (i.e. Qt4 Dlls don't match Qt5 Dlls). Download the Qt source code and compile it for static linking. Then when you build your code you will get a much larger executable file, but it will contain everything it needs - a standalone executable. This is perhaps a bit more work on your part, but master this and it makes deploying your project from PC to PC much easier. Have a go at one or other method, if you get stuck then ask again. But as SGaist said, there is lots of documentation out there already : )
    • [solved] Qt5.5 static build failed: QQmlDebugServerThread::run(): error: undefined reference to 'QTcpServerConnection::QTcpServerConnection()'
      General and Desktop • linux qt5.5 static build • • code_fodder  

      9
      1
      Votes
      9
      Posts
      6880
      Views

      I can confirm similar issue on Mac OS X 10.11.3. But successful build was with with flags: -nomake examples -nomake tests
    • How to build Qt5.5 with QWebEngine staticly?
      QtWebEngine • qt5.5 qtwebengine static build • • Duino  

      2
      0
      Votes
      2
      Posts
      1163
      Views

      Waiting online~~~
    • [SOLVED]Deploying a Qt Quick 2 plugin with a static build
      QML and Qt Quick • deployment static build qt.conf qmldir extension plugi • • Monomix  

      6
      1
      Votes
      6
      Posts
      4150
      Views

      On it. Merci!