Root and GSI QtRoot classes linker failed

Dear all,
I’m trying to compile minimalistic app with QRootApplication including GSI interface for QrROOT integration. Compilation is fine (I see all headers), however I’m faced with linking problem:

[ 12%] Linking CXX executable run
CMakeFiles/run.dir/QtRoot/QRootCanvas.cpp.o: In function `QRootCanvas::executeMenu(int)':
QRootCanvas.cpp:(.text+0x46f4): undefined reference to `typeinfo for TGedEditor'
CMakeFiles/run.dir/QtRoot/QRootWindow.cpp.o: In function `TGWindow::HandleExpose(Event_t*)':
QRootWindow.cpp:(.text._ZN8TGWindow12HandleExposeEP7Event_t[_ZN8TGWindow12HandleExposeEP7Event_t]+0x33): undefined reference to `TGClient::NeedRedraw(TGWindow*, bool)'
CMakeFiles/run.dir/QtRoot/QRootWindow.cpp.o: In function `TGDimension::TGDimension(unsigned int, unsigned int)':
QRootWindow.cpp:(.text._ZN11TGDimensionC2Ejj[_ZN11TGDimensionC5Ejj]+0x11): undefined reference to `vtable for TGDimension'
CMakeFiles/run.dir/QtRoot/QRootWindow.cpp.o: In function `TGDimension::~TGDimension()':
QRootWindow.cpp:(.text._ZN11TGDimensionD2Ev[_ZN11TGDimensionD5Ev]+0xb): undefined reference to `vtable for TGDimension'
...

I’ve attached this little example below. Do anybody have an idea why I do not see these definitions? I’ve compiled root with -Dqt=ON -Dqtgsi=ON

Thanks in advance for help,
Bartek

qrootgsi.tar.gz (21.5 KB)


ROOT Version: 14.02
Platform: Centos 7
Compiler: gcc 7.3.0


Can anyone add some hints in this topic?

Hi,

I’ll check next week (we are in a conference this week)

Cheers, Bertrand

Try with:

target_link_libraries(run
                      ${ROOT_LIBRARIES} ${ROOT_LIBRARY_DIR}/libGui.so
                      ${ROOT_LIBRARY_DIR}/libGed.so
                      Qt5::Widgets
                      Qt5::Gui
                      X11
                      ${QT5ALL_LDFLAGS})

Indeed that works! Thank you! Is there special reason why the libGui.so is not included from the ${ROOT_LIBRARIES}?

1 Like

${ROOT_LIBRARIES} is the minimal set of libraries

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