How to make binary distribution of Qt application for Linux

后端 未结 8 945
小蘑菇
小蘑菇 2020-12-13 20:36

I am developing cross-platform Qt application. It is freeware though not open-source. Therefore I want to distribute it as a compiled binary.

On windows there is no

8条回答
  •  被撕碎了的回忆
    2020-12-13 21:18

    sybreon's answer is exactly what I have done. You can either always add your libraries to LD_LIBRARY_PATH or you can do something a bit more fancy:

    Setup your shipped Qt libraries one per directory. Write a shell script, have it run ldd on the executable and grep for 'not found', for each of those libraries, add the appropriate directory to a list (let's call it $LDD). After you have them all, run the binary with LD_LIBRARY_PATH set to it's previous value plus $LDD.

    Finally a comment about "I'll have to rebuild all of them from scratches". No, you won't have to. If you have the dev packages for those libraries, you should have .a files, you can statically link against these.

提交回复
热议问题