Class.h and Class.java both define zero-arg constructor

Adam Megacz gcj@lists.megacz.com
Mon Dec 10 17:45:00 GMT 2001


Hrm,
Class.h:
 // This constructor is used to create Class object for the primitive
 // types. See prims.cc.
 Class ()
 {
 // C++ ctors set the vtbl pointer to point at an offset inside the vtable
 // object. That doesn't work for Java, so this hack adjusts it back.
 ((_Jv_Self *)this)->vtable_ptr -= 2 * sizeof (void *);
 }
Class.java:
 // Don't allow new classes to be made.
 private Class ()
 {
 }
gcj:
/usr/local/cross-gcc/bin/../lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libgcj.a(natClass.o): In function `Z17_Jv_GetArrayClassPN4java4lang5ClassEPNS0_11ClassLoaderE':
/home/megacz/cross-gcc/gcc-bin/i686-pc-mingw32/libjava/../../../gcc/libjava/java/lang/Class.h(.text$_ZN4java4lang5ClassC1Ev+0x0): multiple definition of `java::lang::Class::Class()'
/usr/local/cross-gcc/bin/../lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libgcj.a(Class.o):/home/megacz/cross-gcc/gcc-bin/i686-pc-mingw32/libjava/../../../gcc/libjava/java/lang/Class.java:222: first defined here
For now I'm just commenting out the one in Class.java...
 - a


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /