Independent qt application and dependency packing

2019-08-10 20:44发布

I made an application for Linux using QtCreator. The application uses two external libraries, qextserialport and qwt. I want to deploy the app such that all libraries it depends on are deployed alongside the executable file.

When I made an application for Windows I just copied the .dll files into the app.exe folder, and it works. But how do I do this on Linux?

1条回答
乱世女痞
2楼-- · 2019-08-10 20:56

In Linux you can:

1) static-link the dependencies

or

2) pack dependencies windows-style and set environment variable LD_LIBRARY_PATH pointing to the subdirectory containing the dynamic libraries

[updated]

read man ld, may be you will have to compile static versions of the libraries if they are not compiled by default (look at this tutorial if you can't tell the difference).

Great comment by synthesizerpatel, if the library uses autoconf (a lot of linux software do), it has options like --enable-shared and --enable-static.

查看更多
登录 后发表回答