On 16/11/12 03:07, Lisandro Dami�n Nicanor P�rez Meyer wrote:
> Bah, I sent this privately to Arnaud instead of to the list.
> Arnaud, can you please resend your replies to the list?
> Kinds regards, Lisandro.
> On Wed 14 Nov 2012 09:53:33 usted escribi�:
>> Do you mean that you were able to build qextserialport against a Qt
>> installation that doesn't have QtGui? Because that is the problem I'm
>> facing: the dynamic library is linked with -lQtGui, but there is no QtGui
>> It's true that after the link, there will not be a dependency on QtGui.so
>> because qextserialport doesn't use any of QtGui's symbols.
> In platforms != Windows AFAIU.
> If I correctly understand, with the last fix to the build system, QtGui is
> only linked on Windows, as it should.
> You can check the latest commit on the repo or get the source tarball I used
> to create the package from Debian:
I checked again, and here are the issues:
- AFAICS, on all platforms, the default mkspecs does 'QT += gui' (and usually
also network), even if there is no QtGui library. Also, according to the qmake
documentation: "If you want to build a project without the QtGui module, you
need to exclude the gui value with the "-=" operator."
- As a check, I built current git against the (Debian) Qt install on my laptop:
g++ -m64 -Wl,-O1 -shared -Wl,-soname,libqextserialport.so.1 -o libqextserialport.so.1.2.0 qextserialport.o
qextserialenumerator.o qextserialport_unix.o qextserialenumerator_linux.o -L/usr/lib/x86_64-linux-gnu -lQtGui -lQtCore
$ readelf -d libqextserialport.so
Dynamic section at offset 0xf250 contains 32 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libQtGui.so.4]
0x0000000000000001 (NEEDED) Shared library: [libQtCore.so.4]
So I think removing gui from qmake's QT variable is a good idea in general.
And some platforms add network and/or opengl to QT as well, so they should
also be removed.