# Error building 8.2.0 on macOS Mojave

**URL:** https://discourse.vtk.org/t/error-building-8-2-0-on-macos-mojave/604
**Category:** Support
**Created:** [March 25, 2019, 9:02pm UTC](https://discourse.vtk.org/t/error-building-8-2-0-on-macos-mojave/604 "2019-03-25T21:02:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![langer](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/3e96dc/32.png) [@langer](https://discourse.vtk.org/u/langer)
#### Post date: [March 25, 2019, 9:02pm UTC](https://discourse.vtk.org/t/error-building-8-2-0-on-macos-mojave/604/1 "2019-03-25T21:02:19Z")

</div>

Hi –

When building VTK 8.2.0 on macOS Mojave, configured with VTK\_USE\_X=ON  
and VTK\_USE\_COCOA=OFF, I get this error:

```
[42%] Linking CXX shared library ../../lib/libvtkRenderingOpenGL2-8.2.dylib
Undefined symbols for architecture x86_64:
  "_glXChooseFBConfig", referenced from:
      vtkXOpenGLRenderWindowTryForFBConfig(_XDisplay*, int, int, int, int, int, bool) in vtkXOpenGLRenderWindow.cxx.o
  "_glXCreateContext", referenced from:
      vtkXOpenGLRenderWindow::CreateAWindow() in vtkXOpenGLRenderWindow.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)
make[2]: *** [lib/libvtkRenderingOpenGL2-8.2.1.dylib] Error 1
make[1]: *** [Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/all] Error 2
make: *** [all] Error 2
```

If I don’t use the default values for OPENGL\_INCLUDE\_DIR,  
OPENGL\_gl\_LIBRARY, and OPENGL\_glu\_LIBRARY, and instead set them like this:

```
OPENGL_INCLUDE_DIR /opt/local/include 
 OPENGL_gl_LIBRARY /opt/local/lib/libGL.dylib 
 OPENGL_glu_LIBRARY /opt/local/lib/libGLU.dylib
```

then I get this error:

```
[38%] Linking CXX shared library ../../lib/libvtkRenderingOpenGL2-8.2.dylib
Undefined symbols for architecture x86_64:
  "_kCFCoreFoundationVersionNumber", referenced from:
      vtkOpenGLRenderer::HaveApplePrimitiveIdBug() in vtkOpenGLRenderer.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)
make[2]: *** [lib/libvtkRenderingOpenGL2-8.2.1.dylib] Error 1
make[1]: *** [Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/all] Error 2
make: *** [all] Error 2
```

I’m using X11 modules from MacPorts, and the /opt/local values allowed  
earlier versions of VTK to build for both X11 and Cocoa builds,  
(although I never got the X11 build to run correctly).

Any suggestions as to what I might be missing would be appreciated.

Thanks.  
– Steve
