I have an application written in pure C++ and Qt 5.5.1. It compiles fine in both GCC (Lubuntu 15.10 x86) and MSVC 14.0 (Windows 8.1 x64), and works properly on both those platforms. I now want to distribute it so that it will run on other Linux distros without recompiling them there.
I'm not entirely sure how to achieve this; the Qt docs page generally suggests to link everything statically, but this is not what most other sources say (from what I understand it is a bad idea to link with glibc
statically). In any case I cannot really link everything statically because GCC complains that Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
and from what I understand this isn't a warning one can simply ignore. I've tired linking statically against only libgcc
and libstdc++
, I copied the other missing libraries - libXau.so.6
, libXdmcp.so.6
and libxcb.so.1
on a clean CentOS 7 installation and tried to run the program there, but that gave me a segmentation fault; possibly because the system is 64 bit as opposed to the platform I compiled the application on?
- How can I distribute the application in a form runnable by most common configurations? Static linking is not an issue because the source is going to be released anyway.
- Is it better to link against Qt statically or dynamically (if maximum binary portability is the priority)?
- Do I need to provide two separate versions of the binary, 32 and 64 bit, or will a 32 bit build suffice?