qmake library reordering
- by user1095108
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.