Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMP: Fix link error when toggling Slicer_BUILD_WEBENGINE_SUPPORT #1137

Closed

Conversation

jcfr
Copy link
Member

@jcfr jcfr commented May 9, 2019

This commit ensures the moc_*.cpp and moc_*.parameters files are regenerated
when the option Slicer_BUILD_WEBENGINE_SUPPORT is toggled.

It address the following errors reported when setting Slicer_BUILD_WEBENGINE_SUPPORT
to ON after Slicer was first build with the option OFF:

  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

See https://discourse.slicer.org/t/build-error-linux/6738

This commit ensures the moc_*.cpp and moc_*.parameters files are regenerated
when the option Slicer_BUILD_WEBENGINE_SUPPORT is toggled.

It address the following errors reported when setting Slicer_BUILD_WEBENGINE_SUPPORT
to ON after Slicer was first build with the option OFF:

  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

See https://discourse.slicer.org/t/build-error-linux/6738
@lassoan
Copy link
Contributor

lassoan commented May 9, 2019

It would be nice to fix the MRML_WIDGETS_HAVE_WEBGINE_SUPPORT typo.

@jcfr
Copy link
Member Author

jcfr commented May 9, 2019

typo

Good catch. Indeed, I will do a first commit fixing the typo, and then the bug fixes for the link error

@gregsharp
Copy link

Testing now.

Why would the option Slicer_BUILD_WEBENGINE_SUPPORT be toggled? I am building from a fresh build tree and never touch that option.

@jcfr
Copy link
Member Author

jcfr commented May 9, 2019

Why would the option Slicer_BUILD_WEBENGINE_SUPPORT be toggled?

To clarify, if you do a clean build (with option Slicer_BUILD_WEBENGINE_SUPPORT set to ON (default) or OFF), there are no issues. Nightly builds (as well some of our custom Slicer app build) confirm this.

The problem arises in that case:

  • do a clean build with Slicer_BUILD_WEBENGINE_SUPPORT either ON (default) or OFF
  • toggle Slicer_BUILD_WEBENGINE_SUPPORT, then reconfigure. Problem happens at that time. I encountered the same problem yesterday in one of my build tree ... and I think this patch will address that.

@gregsharp
Copy link

It seems the problem is resolved with the patch. Thank you!
But without the patch, I still reproduce the problem starting from a fresh build tree and I never touch the option.

@jcfr
Copy link
Member Author

jcfr commented May 9, 2019

I still reproduce the problem starting from a fresh build tree and I never touch the option.

Gotcha. I will clarify this in the commit message. Thanks again for taking the time to test and report back 🙏

@jcfr
Copy link
Member Author

jcfr commented May 23, 2019

Closing. Fix integrated in r28262 and r28263

@jcfr jcfr closed this May 23, 2019
@jcfr jcfr deleted the fix-link-error-toggle-Slicer_BUILD_WEBENGINE_SUPPORT branch May 23, 2019 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants