[vtkusers] Re: VTK on Mac OS X

Moreland, Kenneth kmorel at sandia.gov
Mon Jan 19 10:49:36 EST 2004


> Really?  You are running VTK/Tcl/Tk programs (*not* compiled, just  
> interpreting a .tcl file), and you are able to properly 
> interact with  
> the windows?  Exactly what program are you invoking to run 
> the VTK .tcl  
> file?

I've gotten everything to work (including Tcl interpreting) on Mac 10.2.6
using X11 libraries.  The trick is to realize that there are most likely two
versions of any library involving graphics: a native version using Carbon or
Cocoa and a X11 version.  The native libraries are usually linked with
-framework command line options and X11 libraries are usually linked with -l
and -L options.  If you're using the wrong library or both libraries, you
are bound to get linking errors.

So, for example, if you wish to compile with X11, you need to have flags
like "-L/usr/X11R6 -lGLU -lGL" rather than "-framework AGL -framework
OpenGL".  If I recall correctly, CMake is kinda stupid in picking the
correct OpenGL libraries.  It will grab the Carbon/Cocoa versions even if
you are using X11.  You need to set the following:

 OPENGL_INCLUDE_DIR               /usr/X11R6/include
 OPENGL_gl_LIBRARY                /usr/X11R6/lib/libGL.a
 OPENGL_glu_LIBRARY               /usr/X11R6/lib/libGLU.a

If you want to use Tcl (or more specifically Tk), you cannot use the binary
libraries downloaded off the net with X11.  I did it by getting the source
code, compiling it as a UNIX/X11 library, and linking off of that.

-Ken




More information about the vtkusers mailing list