-lImt not present in root-config --libs

Hello, I installed from sources ROOT 6.10/02. I develop a small Qt project that uses ROOT libraries. My .pro file looks like


QT += widgets testlib

CONFIG += staticlib

linux-g++* {
        CONFIG += use_ROOT

use_ROOT {
    DEFINES += "ROOTdef"
    LIBS += $$system(root-config --libs) \
    QMAKE_CXXFLAGS += $$system(root-config --cflags)

LIBS += -L/opt/Qt/lib/ \

QMAKE_LFLAGS += -static-libgcc

    main.cpp \
    MaFenetre.cpp \
    MonFichierBin.cpp \
    MonFichierConf.cpp \
    MonFichierConfSource.cpp \

HEADERS += MaFenetre.h \
    MonFichierBin.h \
    MonFichierConf.h \
    MonFichierConfSource.h \
    MonFichierIfm.h \

I had to add -LImt by hand in the LIBS variable because otherwise I got such message in Qt Creator

g++ -static-libgcc -o RNBinIms main.o MaFenetre.o MonFichierBin.o MonFichierConf.o MonFichierConfSource.o MonFichierIfm.o moc_MaFenetre.o -L/opt/root/lib -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -pthread -lm -ldl -rdynamic -L/opt/Qt/lib/ -L/usr/lib64/ -L/opt/Qt/lib -lQt5Widgets -lQt5Gui -lQt5Test -lQt5Core -lGL -lpthread
/usr/bin/ld: warning: libImt.so, needed by /opt/root/lib/libTree.so, not found (try using -rpath or -rpath-link)
/opt/root/lib/libTree.so: référence indéfinie vers « ROOT::TThreadExecutor::ParallelFor(unsigned int, unsigned int, unsigned int, std::function<void (unsigned int)> const&) »
/opt/root/lib/libTree.so: référence indéfinie vers « ROOT::TThreadExecutor::TThreadExecutor() »
Makefile:264: recipe for target ‘RNBinIms’ failed
collect2: erreur: ld a retourné 1 code d’état d’exécution

Is there any reason explaining why -lImt is not included in the output of root-config --libs?

Hi @pamputt,
the reasons for that flag missing have to do with being very conservative in what we consider “default”.
With this said, newer versions of ROOT have inserted it to avoid the problems you see.
v6.11 and maybe also v6.10/8 have -lImt as part of the output of root-config --libs

Hi. Good to know that it is part of the enxt release.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.