How to deploy Qt+Boost Application on Mac OS X or Windows platform.
I use Qt Creator + Qt 4.6 + MacOS 10.6
How to compile my application into release to run it on another computer w/o installed Qt libraries?
I ship Windows apps built with Qt and I use the Dependency Walker tool to first determine which Qt and MinGW DLLs are required. For Qt 4.6 apps you'll need to always ship the mingwm10.dll and libgcc_s_dw2-1.dll files found in your Qt bin folder (default location of this will be C:\Qt\2009.05\qt\bin).
Depending on which Qt modules you use will determine which Qt DLLs are shipped - you'll always need to ship QtCore4.dll. If you use networking then you'll need QtNetwork4.dll and so on - Dependency Walker will show you.
Note that you should only ship Qt files found in C:\Qt\2009.05\qt\bin and NOT those in C:\Qt\2009.05\bin - the latter folder contains MSVC built Qt DLLs used by Qt Creator and other tools and, assuming you're building using MinGW, these will not work with your app.)
I install these files in the application folder, which isn't ideal if you have multiple products that use Qt. If you are using the same version of Qt for all your projects then you could install the Qt files into a special folder that is then added to the user's PATH. YMMV and this is a big topic in itself.
For Qt, refer to the docs on deployment (Windows, Mac). Keep in mind that Qt is quite big - if you decide to link statically consider building a version of Qt that only contains the modules you need.
Most boost libraries are header only and thus need no deployment. For those that are not (thread, ...) refer to the respective documentation on building and deploy them like any other library.
Related
I am building an application using Qt C++ and I want it to run on windows computers without having to install VC Redistributables. Apparently when user tries to run the application an error pops that says that VCRUNTIME140.dll is missing.
Build both Qt and your application using compiler option /MT?
https://learn.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-170
I recommend using GCC (i.e. MinGW) as the compiler. If you do that, your app will generall depend on the msvcrt.dll that comes with Windows and doesn't need to be installed specially (but it depends on exactly how the GCC compiler is configured). It will also possibly depend on some GCC runtime library DLLs that you can just put in the same directory as your EXE.
MSYS2 is a good development environment for using MinGW on Windows: https://msys2.org
I also made a useful set of tools that is capable of cross-compiling statically-linked MinGW/Qt applications from Linux: https://github.com/DavidEGrayson/nixcrpkgs
The Qt applications I build with nixcrpkgs come out as single, standalone EXEs that do not need to be shipped with any DLLs.
I need to write Linux software for labs. Put on Virtual Box Mint (wrote that it is best for beginners fit). Installed QT Creator, like all the files needed downloaded. But in the end I still can not create a project.
Qt Creator is just the editor.
You still need to have at least one version of the Qt framework installed - either from an installer, built from source or from a package manager.
The installer bundles a copy (non optional) of Creator, configured to use it.
If you build from source you will have to add the Qt version (профили Qt) and make a kit (комплектьi) from it and a compatible compiler.
I am currenyly using Debian Jessie and I have Qt Creator installed with Qt 5.3.3. It works fine, however there are some issues like QSystemTrayIcon not appearing properly, which I understand doesn't occur on versions earlier than 5.0.0, so I would like to be able to switch which version I am building with. Where can I download the necessary files that I can then point to from the Qt Versions tab in Qt Creator? Currently I can only choose 5.3.3. I would need something like 4.8.6 too.
You can install the Qt 4 development package, libqt4-dev, using your package manager. If you need a different version, you'll need to build it yourself from one of the source packages in the Qt Project's archive. Make sure to set an install prefix outside of your usual /usr, unless you know exactly what you're doing. Usually the prefix /opt is used for this kind of thing.
After it is installed, you can try restarting Qt Creator, and see if it is picked up automatically. If not, you can add it manually by creating a manual Qt version and pointing it to /usr/bin/qmake-qt4 (or something like /opt/qt-4.8.6/bin/qmake if you built Qt yourself and installed in the prefix /opt/qt-4.8.6). You then need to set up a "Kit" as well, and then you can add a "Kit" to your project build configuration (on the projects tab in the main window).
I am having a difficult time trying to find a way to link the Qt library to my Eclipse project.
The Qt SDK package 4.8.1
with
Eclipse CDT Juno
Is there a way to link Qt libraries to eclipse?
UPDATE: It appears that the Eclipse plugin is no longer officially supported but that it's still available via download. The link below references their ftp site.
Nokia provides Eclipse-Qt integration. That said, it's unnecessary as it's always possible to use an Eclipse project that's using custom build commands. You could simply create a makefile project making certain to run qmake at the appropriate times.
To start, it might be as simple as:
Create a file or two
qmake -project # create your project file
qmake # generate your makefile
# tell eclipse to build the project
If the above, you'd only need to re-run qmake when adding new files and doing other things that affect the qt project file.
#enobayram
Yes it does.
The Qt integration pack is 32bit and therefore all depencies like Eclipse / Java / Qt must be also 32bit.
After successfully installing the Qt SDK 4.7.4 (MingW) and building an application I can find no way to deploy my program. Qt is really nice, but to deploy under Windows means to leave he surfaced road.
First the executable requires QtCore4.dll plus some other DLLs, but the Creator does not copy them into the deploy folder. Do I really have to try DEPENDS.EXE, to find out which DLLs are required, and then cull them manually from somewhere under C:/QtSDK?
Be that as it may, preferably I want to link statically. There are few recipes on the net how this can be done (e.g. here and here). So I launched a Qt 4.7.4 Desktop (MingW) command prompt. The Qt Reference Documentation tells to run CONFIGURE.EXE, but there's no CONFIGURE.EXE and no CONFIGURE.CMD, not under C:/QtSDK and not under C:/.
What am I missing?