[vtkusers] Compiling VTK Java wrappers on MacOSX Panther
David Clunie
dclunie at dclunie.com
Fri Jul 30 06:44:36 EDT 2004
On Panther, I can the latest VTK CVS source to compile as long as
I do not include the Java wrappers (I tried and failed with 4.2 and
4.4).
Since the goal of my project is to use VTK from Java on the Mac,
I have to, and if I do, I get ...
Building object file vtkRenderWindowJava.o...
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:5,
from /System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:8,
from /System/Library/Frameworks/AppKit.framework/Headers/NSView.h:8,
from /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jawt_md.h:11,
from /Volumes/Inside Helgray - User/Users/dclunie/Work/VTK/VTK/Common/vtkJavaAwt.h:16,
from /Volumes/Inside Helgray - User/Users/dclunie/Work/VTK/VTK/Rendering/vtkRenderWindowJava.cxx:1174:
/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:56: error: parse
error before `@' token
/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:58: error: syntax
error before `*' token
...
This is on:
System Version: Mac OS X 10.3.4 (7H63)
Kernel Version: Darwin 7.4.0c++ (GCC) 3.3 20030304 (Apple Computer, Inc. build 1495)
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-135)
Java HotSpot(TM) Client VM (build 1.4.2-36, mixed mode)
(Admittedly the JDK is a developer preview, 1.4.2 DP3, rather
than the production 1.4.2, but I do not think that has anything
to do with the problem).
Looking in NSObjCRuntime.h, line 56 is:
@class NSString;
Is the build failing because this is an Objective C statement rather
than C or C++, and vtkRenderWindowJava.cxx is a C++ file, and g++
uses the file name extension to choose the language ?
Just a thought.
Commenting out the '#include "vtkJavaAwt.h"' in vtkrenderWindowJava.cxx
allowed the compile to get past this point, but since that line is
added specifically by vtkWrapJava.c, and since vtkJavaAwt.h is not
invoked elsewhere and hence the JNI methods that it defines never
compiled, this will haunt me later I am sure.
Any suggestions ?
david
PS. Also, VTK_USE_HYBRID had to be ON, else complained about
missing BoxWidget and PlaneWidget in java wrapper tests.
More information about the vtkusers
mailing list