Build error linux related to introduction of Slicer_BUILD_WEBENGINE_SUPPORT option

Build failure in clean build directory.

CMakeFiles/qMRMLWidgets.dir/qMRMLLayoutManager.cxx.o: In function `qMRMLLayoutChartViewFactory::qMRMLLayoutChartViewFactory(QObject*)':
qMRMLLayoutManager.cxx:(.text+0x7b0): undefined reference to `vtable for qMRMLLayoutChartViewFactory'
CMakeFiles/qMRMLWidgets.dir/qMRMLLayoutManager.cxx.o: In function `qMRMLLayoutManager::setMRMLColorLogic(vtkMRMLColorLogic*)':
qMRMLLayoutManager.cxx:(.text+0x4c74): undefined reference to `qMRMLLayoutChartViewFactory::staticMetaObject'
CMakeFiles/qMRMLWidgets.dir/qMRMLLayoutManager.cxx.o: In function `qMRMLLayoutManager::mrmlColorLogic() const':
qMRMLLayoutManager.cxx:(.text+0x4d3f): undefined reference to `qMRMLLayoutChartViewFactory::staticMetaObject'
collect2: error: ld returned 1 exit status
Libs/MRML/Widgets/CMakeFiles/qMRMLWidgets.dir/build.make:3695: recipe for target 'bin/libqMRMLWidgets.so' failed

Looking at qMRMLWidgetsConfigure.h, I get:

#define MRML_WIDGETS_HAVE_QT5
#define MRML_WIDGETS_HAVE_WEBGINE_SUPPORT

Please provide more information. What Linux are you using and which version? which Slicer version are you building? Did you install all required dependencies?

Does your Qt have WebEngine component enabled?

@lassoan Yes. The following are installed: qtwebengin5-dev, libqt5webengine-data, libqt5webengine5, libqt5webenginewidgets5, libqt5webenginecore5.
@brhoom This is debian stable, and HEAD.

Is this the latest master version? There were a few days recently when there were build similar errors but @jcfr fixed those. You can also try disabling Slicer_BUILD_WEBENGINE_SUPPORT to skip all webengine related components (extension manager and the legacy chart view will not be available, but everything else should work; and the Slicer package will be 100-150MB smaller).

If you are toggled Slicer_BUILD_WEBENGINE_SUPPORT ON and OFF in an existing build tree, you may have to delete the following files from the inner build tree, reconfigure and build the inner project:

./Libs/MRML/Widgets/moc_qMRMLLayoutManager.cpp_parameters
./Libs/MRML/Widgets/moc_qMRMLLayoutManager_p.cpp
./Libs/MRML/Widgets/moc_qMRMLLayoutManager.cpp
./Libs/MRML/Widgets/moc_qMRMLLayoutManager_p.cpp_parameters

Yes, I am at HEAD of master branch. Disabling Slicer_BUILD_WEBENGINE_SUPPORT allows the build to complete, thank you.

I looked through the source a bit, but did not find any obvious difference between, say, qMRMLLayoutChartViewFactory and qMRMLLayoutThreeDViewFactory. But it seems only the former is giving undefined symbols.

This should help address the issue. See https://github.com/Slicer/Slicer/pull/1137

To follow up, fixes have been integrated in r28262 and r28263

1 Like

Fix confirmed. Thanks Jc!

1 Like