qmake library reordering

Posted by user1095108 on Stack Overflow See other posts from Stack Overflow or by user1095108
Published on 2012-07-10T09:06:03Z Indexed on 2012/07/10 9:15 UTC
Read the original article Hit count: 151

Filed under:
|
|

I put this into a qmake file:

QTPLUGIN += component
LIBS += -L../lib -lmodule -lcomponent -lnetworking

But qmake reorders the libraries behind my back:

g++ -m64 -Wl,-O1,--sort-common,--as-needed,-z,relro -o testb .obj/constants.o .obj/main.o .obj/qrc_application.o    -L/usr/lib -L../lib -lmodule -lnetworking -lcomponent -lQtGui -lQtNetwork -lQtCore -lpthread

Probably because component is a static plugin. But it has a static dependency on the networking library and hence the reordering causes a link error. It is a static dependency and hence is ok in my opinion. How to work around this? I'm using qt 4.8.1.

© Stack Overflow or respective owner

Related posts about qt

Related posts about g++