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

VTK_USE_COCOA not set #2

Closed
samuelgerber opened this issue Oct 6, 2020 · 1 comment · Fixed by #10
Closed

VTK_USE_COCOA not set #2

samuelgerber opened this issue Oct 6, 2020 · 1 comment · Fixed by #10

Comments

@samuelgerber
Copy link
Contributor

samuelgerber commented Oct 6, 2020

When building on macOSX the linking step fails with:

[ 21%] Linking CXX shared library /Users/sam/Software/SlicerLookingGlass-build/lib/Slicer-4.13/libvtkRenderingLookingGlass.dylib
Undefined symbols for architecture x86_64:
  "vtkCocoaLookingGlassRenderWindow::SetLGDeviceIndex(int)", referenced from:
      vtkLookingGlassInterface::CreateLookingGlassRenderWindow(int) in vtkLookingGlassInterface.cxx.o
  "vtkCocoaLookingGlassRenderWindow::New()", referenced from:
      vtkLookingGlassInterface::CreateLookingGlassRenderWindow(int) in vtkLookingGlassInterface.cxx.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The issue appears to be that VTK_USE_COCOA is not set and the files are not included in CMakeLists.txt in the LookingGlassVTKModule here:
https://github.com/Kitware/LookingGlassVTKModule/blob/f3b4c8928c002533337479733af4ec10282c7aa9/CMakeLists.txt#L13

By including the mac specific source files the build works.

This might be related to a warning during the CMake configuration step:

CMake Deprecation Warning at /Users/sam/Software/Slicer-build/VTK-build/lib/cmake/vtk-9.0/vtk-use-file-deprecated.cmake:1 (message):
  The `VTK_USE_FILE` is no longer used starting with 8.90.
Call Stack (most recent call first):
  /Users/sam/Software/Slicer-build/Slicer-build/UseSlicer.cmake:134 (include)
  CMakeLists.txt:23 (include)
@jcfr
Copy link
Contributor

jcfr commented Oct 16, 2020

Thanks for the detailed report, root cause has been identified and reported in https://gitlab.kitware.com/vtk/vtk/-/issues/18032

Waiting this is addressed a workaround will be added to the SlicerLookingGlass extension

jcfr added a commit that referenced this issue Oct 16, 2020
This commit works around issue https://gitlab.kitware.com/vtk/vtk/-/issues/18032
and fixes the following link error:

  [ 14%] Linking CXX shared library /Users/jcfr/Projects/SLG-rwdi/lib/Slicer-4.13/libvtkRenderingLookingGlass.dylib
  Undefined symbols for architecture x86_64:
    "vtkCocoaLookingGlassRenderWindow::SetLGDeviceIndex(int)", referenced from:
        vtkLookingGlassInterface::CreateLookingGlassRenderWindow(int) in vtkLookingGlassInterface.cxx.o
    "vtkCocoaLookingGlassRenderWindow::New()", referenced from:
        vtkLookingGlassInterface::CreateLookingGlassRenderWindow(int) in vtkLookingGlassInterface.cxx.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Fixes #2

Co-authored-by: Samuel Gerber <samuel.gerber@kitware.com>
@jcfr jcfr closed this as completed in #10 Oct 16, 2020
jcfr added a commit that referenced this issue Oct 16, 2020
This commit works around issue https://gitlab.kitware.com/vtk/vtk/-/issues/18032
and fixes the following link error:

  [ 14%] Linking CXX shared library /Users/jcfr/Projects/SLG-rwdi/lib/Slicer-4.13/libvtkRenderingLookingGlass.dylib
  Undefined symbols for architecture x86_64:
    "vtkCocoaLookingGlassRenderWindow::SetLGDeviceIndex(int)", referenced from:
        vtkLookingGlassInterface::CreateLookingGlassRenderWindow(int) in vtkLookingGlassInterface.cxx.o
    "vtkCocoaLookingGlassRenderWindow::New()", referenced from:
        vtkLookingGlassInterface::CreateLookingGlassRenderWindow(int) in vtkLookingGlassInterface.cxx.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Fixes #2

Co-authored-by: Samuel Gerber <samuel.gerber@kitware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants