Deployment of QT apps on linux

两盒软妹~` 提交于 2019-12-13 11:10:53

问题


I have developed Qt app in ubuntu-14.04 operating system . I need to deploy the executable file into target system without using any tool. Can u please guide me how I should proceed .Any information about it would be useful for me . Waiting for your reply.. Thanks in advance..

Thanks and Regards, Aryan


回答1:


Deploying a dynamically linked Qt application :

You should place Qt .so files along the release version of your executable. These are libQtCore.so, libQtGui.so and possibly the ones for other modules that you have used. These so files are in your installed Qt directory in lib folder or in the directory /usr/lib/i386-linux-gnu. If you are using plugins you should place their so files in a folder named plugins beside your binary. In case of using icons and images you should ship their so files like libqico.so and libqsvg.so in a folder named imageformats.

Gathering required shared libraries :

If you want your application to run independently on a bare installed Linux, you should gather all dependent shared libraries and put them in your application directory. You can simply do it by a shell script named cpld. You can easily copy all dependencies to a folder.

It's worthy to note that you can put this in your .pro file to cause the dynamic linker to look in the same directory as your Qt application at runtime in Linux :

unix:{
    # suppress the default RPATH if you wish
    QMAKE_LFLAGS_RPATH=
    # add your own with quoting gyrations to make sure $ORIGIN gets to the command line unexpanded
    QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
}



回答2:


I need to deploy the executable file into target system without using any tool.

That's unlikely. I expect you actually need to package your application so that it can be installed using the standard package-management system (i.e. dpkg, apt-get and friends).

Read up on creating Debian packages and come back here (or, more likely, the Linux&Unix stackexchange) when you've made an effort.



来源:https://stackoverflow.com/questions/30506314/deployment-of-qt-apps-on-linux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!