[Insight-users] Re: please tell me how to build java-wrapped ITK

Brad King brad.king at kitware.com
Mon Jul 19 14:45:45 EDT 2004


Yixun,

Yixun Liu Wrote:
>I am sorry to bother you. I know you can successfully  build Java-wrapped ITK class from your mail.  I do not konw how to build this. 
  I do as follow, but alwayse receive error information.
>
>1. set the "share lib" ON
>
>enable "ITK_CSWIG_JAVA" and set the
>
>    JAVA_COMMAND
>    JAVA_ARCHIVE
>    JAVA_COMPILE
>    JAVA_INCLUDE_PATH
>    JAVA_RUN_TIME
>
>correctly.
>
>2.copy cableswig to the utility directory
>
>3.load ITK.dsw and build the release version
>
>
>I receive the following error information:
>
>C:\ITK\Insight\Utilities\CableSwig\GCC\libiberty\floatformat.c(27) : error C2371: 'memcpy' : redefinition; different basic types
>C:\ITK\Insight\Utilities\CableSwig\GCC\libiberty\floatformat.c(28) : error C2371: 'memset' : redefinition; different basic types

The code producing this error looks like this:

#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 ();
#endif

This code is part of the GCC parser that is used by CableSwig to produce 
wrappers.  The compiler is not defining __STDC__.  Since you said you 
are loading "ITK.dsw" I'll assume your using MSVC 6.  In fact this 
compiler does not define __STDC__ unless the "/Za" flag is given, but 
I've never had a problem using it to build CableSwig even without this flag.

For some reason your system is providing alternative signatures for 
memcpy and memset that conflict with the ones declared in GCC's 
libiberty.  If you can figure out why this is happening, please let me know.

-Brad

P.S. You can also try building ITK by creating a fresh build tree and 
adding "/Za" to the CMAKE_C_FLAGS advanced cache variable.


More information about the Insight-users mailing list