[Insight-users] Java Wrappers
Alejandro Canales Ochoa
aco at cion.com.mx
Thu, 26 Feb 2004 01:39:31 -0600
Hi
I just followed your instructions and I have a working installation of ITK with java wrappers. I found a couple of issues in the process:
The file CableSwig\GCC\libiberty\floatformat.c did not compile due an error. The definition _STDC_ is not defined in the compilation environment, so the precompiler redefines memcpy and memset:
#ifdef __STDC__
#include <stddef.h>
extern void *memcpy (void *s1, const void *s2, size_t n);
extern void *memset (void *s, int c, size_t n);
#else
extern char *memcpy ();
extern char *memset ();
I just comment out this portion of code and the compilation works fine. I am using Visual C++ 6.0 with any patch applied. I am downloading the Service Pack 5 for Visual C++ and I will try to recompile with the portion of code as it comes from the CVS.
The second issue: After the compilation succeed, I move the jar (InsightToolkit.jar) and the corresponding Dll’s from the build path to another directory. When I run my first program, the java runtime was unable to load the native libraries, no mater I correctly set my CLASSPATH and my PATH (currently I use windows) environment variables to the directory where I move the files.
I look the source code of a class named itkbase and I see that the class expects the Dlls to be in the installation directory, so I point my library path to this directory and voila!, it works!. I think that hard coding the path of the Dlls in this class removes flexibility to the applications developed with the ITK java Wrappers.
Next days I will incorporate some functionality from ITK to my application. I hope I will be lucky.
Thanks for the advice
Alejandro Canales
El Wed, 25 Feb 2004 14:35:32 -0500, luis.ibanez at kitware.com escribio:
>
>
>Hi Alejandro,
>
>It is nice to see that you are
>using ITK so fast after the course :-)
>
>The support for Java wrapping has been
>commited to the repository and you can
>use it now. Bill Hoffman and Brad King
>did this in record time.
>
>
>Make sure that you do:
>
>
>1) Get a fresh checkout of ITK from CVS.
>
>2) Get a fresh checkout of CSwig
>
>3) When you configure ITK with CMake,
> enable the variable:
>
> ITK_CSWIG_JAVA
>
>
>
>You will find a .java example under
>
> Insight/Wrapping/CSwig/Tests/Java
> cannyEdgeDetectionImageFilter.java
>