QT5 Compiling & packaging Dependent DLL Publishing

Source: Internet
Author: User
Tags vc runtime

When I learned C + + ten years ago, I was bored to see almost all the *.dll under the Windows folder. Occasionally when the program runs to see the lack of *.dll hints, will be directly identified to solve.

With the "Development platform" and "compiler" version of the yearly upgrade, a program depends on the link library volume is also growing, this to the Code Farmers, program apes, software siege Lion test and release all caused a relatively big trouble!

Six years ago, did a professional software packaging of the Chinese package, the feeling of professional installation program making tools for some small programs is too wasteful, and users will feel not enough "green". It is a good solution if you can simply complete the package and meet the basic requirements.

Some time ago a lot of people have asked me "what software to do host computer GUI better?" "Recently, I've been looking at Qt for two days, so let's take this to say something."

Qt is a cross-platform C + + graphical user Interface application Development framework developed by caused by parity in 1991. Unlike Java's "compile once, run everywhere", QT is the source-level cross-platform with the "write once, compile Everywhere" feature. Google Earth, Skype, Opera ... Many of the software is written based on Qt.

The latest version is 5.1.1, because the previous period of time to play Linux compilation addiction, also lazy to install Ms Virual studio2010/2012, so downloaded qt-windows-opensource-5.1.1-mingw48_ Opengl-x86-offline.exe (Integrated mingw4.8, OpenGL).

First, installation and setup of software environment

The porting and integration of the 5.1.1 version on the Windows platform is further improved, and does not require cumbersome settings like those on the web that are intended for older versions of the tutorials. Just like a typical Windows Installer you can complete the installation with a mouse click (of course, in the installation note: MinGW is not selected by default).

This is the main reason to continue to look at QT for two days!!!

Second, Project Setup and program compilation

Take a look at the tutorial on the line, just 5.1.1 the tutorial has not yet appeared!

I just found a classic Hello world!. To run for a while, near misses's "build success".

PS: Like all English software, the project path does not have the Chinese, Japanese, Korean, Martian, and so on English-speaking guys do not know the symbol!

PS: Do not think that others compiled by the program will be able to compile successfully, the compilation environment and updates in the software upgrade can lead to failure!

Third, Program Release

The program compiles the default is "Debug", in fact, and "release" generated EXE is similar, but depends on the size of the link library is not the same. For ordinary users, in fact, the size of the program is not sensitive, more people will care about the gorgeous man-machine interface or complex functions. Only demanding embedded system users and obsessive-compulsive Code farmers, program apes, software siege Lions will pursue the ultimate compression volume!

Four, Program Packaging

Demanding embedded system users sometimes prefer to abandon new functionality, requiring stable and reliable applications, and version upgrades are sometimes not as good as those advertised by software developers.

Eg: casually under a "serial debugging assistant" to do model.

QT4 compile this "serial debugging assistant", generate a dependent link library only 4, file size can also be accepted;

Change to Qt5 to compile, will find out a lot more things come out!


Even after packing with the compression tool (
) is still larger than the uncompressed old version!


A small tool (a MinGW compiled QT GUI program), depends on the DLL is too much, really a bit inconvenient. More people in the community are talking about "static compilation," but using "static compilation" is subject to some limitations of open source licensing.

Now it's time for our little partner, Enigma Virtual Box, to behave!!!

Five, Packaging Dependent link Libraries

Enigmavirtual Box The latest version is 6.80 build 20131003, which starts as shown:


Specify the *.exe file generated by QT compilation in the "Enter Input file name" column, and automatically generate the path and file name of the packaged output file in the "Enteroutput file name" column. (Please ignore the ads in the middle!) )

Click on the "Add ..." button at the bottom left to add all the dependent link library files, then click "Filesoptions" in the lower right to select "Enable Files Virtualization" and "Compressfiles" in the popup dialog; "OK "Then return to click on" Process "and wait for the little partner to finish the job.


Small partner generated *.exe file (18.247KB) size is much smaller, and this is a pure "green software", direct copy can be run on any storage media! With this, mother no longer have to worry about the system will suddenly play a box out, prompting the lack of xx.dll files!

Six, Qt5 mainly relies on the link library description

1.QT Module Library

1

2

3

4

Qt5Core.dll #QT核心库

Qt5Gui.dll #QT GUI Library

Qt5Widgets.dll #QT Widgets Library, the GUI program in QT 5 basically requires this DLL

#还有其他程序用到的Qt5XXX. dll

2.ICU Dependent Libraries

(International Component for Unicode,unicode tool)

1

2

3

Icudt51.dll

Icuin51.dll

Icuuc51.dll

3.QT Plugin Library (new library, path must be correct)

1

2

3

4

5

6

# Depending on the program, different plugin libraries are required

#例如 Qt_dir/plugins/*/*.dll

# You need to keep the file structure of Platforms/*.dll,accessible/*.dll

# put in the directory where you compiled the program

Plugins/platforms/qwindows.dll

Plugins/accessible/qtaccessiblewidgets.dll

4.EGL Dependency Library, providing interfaces for Opengl,opengl ES

1

2

LibEGL.dll

LibGLESv2.dll

5.mingw Dependent libraries (these libraries are not required for MSVC compilation)

1

2

3

Libgcc_s_dw2-1.dll

Libstdc++-6.dll

Libwinpthread-1.dll

6.VC runtime (These libraries are not required for MinGW compilation)

1

2

Msvcr110.dll (corresponds to VS2012)

Msvcp110.dll

Finally, let the new small partner Qt5 Say hello to me, and get a little bit!

QT5 compilation & packaging dependent DLL publication

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.