开发者

QT - deploying a C++ application

开发者 https://www.devze.com 2023-04-12 11:52 出处:网络
I just started using QT and I have a question regarding some basic stuff. I have built a project with two files .pro file and .cpp file.

I just started using QT and I have a question regarding some basic stuff.

I have built a project with two files .pro file and .cpp file.

How can I deploy this application a开发者_运维问答nd build the .exe file in order to use it in shell?

Can you recommend me any good tutorial for this?


When you compile the file, it will create a binary executable.

It depends on what you have in your project file as to what it will be called, to set the name in the pro file use:

TARGET = Stores.bin

Or I think it will use the name of the pro file. Linux executables traditionally don't have extensions like windows.

I then create an installer using bitrock's installer:

http://bitrock.com/

Remembering to package up the libraries as well.


A good source of information on deploying Qt programs is the web page Deploying Qt Applications.

See in particular the "Platform-Specific Notes" at the end.

On the above page, the discussion about static versus shared libraries is also important:

There are two ways of deploying an application:

  • Static Linking
  • Shared Libraries (Frameworks on Mac)

Static linking results in a stand-alone executable. The advantage is that you will only have a few files to deploy. The disadvantages are that the executables are large and with no flexibility (i.e a new version of the application, or of Qt, will require that the deployment process is repeated), and that you cannot deploy plugins.


Use compiler to build your source into executables. It's better if you use such an IDE, for QT, it's preferrable to use QTCreator or Eclipse, even CodeBlock.

You can refer to some tutorials:

http://sector.ynet.sk/qt4-tutorial/
http://doc.qt.nokia.com/stable/tutorials.html
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号