[Qt-interest] Linking Weirdness?
Gary Coulbourne
gcoulbourne at mediaguide.com
Tue May 5 19:47:46 CEST 2009
I've noticed, with 4.5.1 on linux, that when Qt reaches the phase of linking
with projects that use pthreads, that it is very persistent about linking the
pthreads library. It REALLY wants pthreads. Take a look at this line from
compiling Creator:
g++ -Wl,-z,origin
'-Wl,-rpath,/usr/local/qt4.5.1/lib:$ORIGIN:$ORIGIN/..:$ORIGIN/../..'
-shared -Wl,-soname,libCodePaster.so -o libCodePaster.so
.obj/release-shared/cpasterplugin.o
.obj/release-shared/settingspage.o .obj/release-shared/cgi.o
.obj/release-shared/fetcher.o
.obj/release-shared/poster.o .obj/release-shared/splitter.o
.obj/release-shared/view.o
.obj/release-shared/moc_cpasterplugin.o .obj/release-shared/moc_settingspage.o
.obj/release-shared/moc_fetcher.o .obj/release-shared/moc_poster.o
.obj/release-shared/moc_view.o
-L/usr/local/qt4.5.1/lib -L/home/gcoulbourne/TEST/creator/lib/qtcreator
-L/home/gcoulbourne/TEST/creator/lib/qtcreator/plugins/Nokia -lUtils
-lQtConcurrent -lAggregation
-lExtensionSystem -lCore -lQuickOpen -lFind -lTextEditor -lProjectExplorer
-lQtTest
-L/usr/local/qt4.5.1/lib -pthread -pthread -lQtGui -L/usr/X11R6/lib -pthread
-lpng -lfreetype
-lgobject-2.0 -lSM -lICE -pthread -pthread -lXrender -lfontconfig -lXext -lX11
-lQtNetwork -pthread
-pthread -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
The -pthread flag gets set at least 9 times in there. GCC collapses them,
obviously, but it makes me wonder; why does Qt's make process spew so many?
My own code sometimes causes Qt to give me 20, 30, or more -pthreads flags.
It seems to be the only flag that Qt gets so hung up on.
Peace,
Gary
More information about the Qt-interest-old
mailing list