natThrowable.lo multiple definition error

Bryce McKinlay bryce@albatross.co.nz
Tue Jan 18 20:52:00 GMT 2000


I'm getting a link error (gcc 2.95.2):

/home/bryce/projects/libgcj/build/i686-pc-linux-gnu/libjava/java/lang/Throwable.h:16:
multiple definition of `java::lang::Throwable::getMessage(void)'
java/lang/Throwable.lo:/home/bryce/projects/libgcj/build/i686-pc-linux-gnu/libjava/../../../libjava/java/lang/Throwable.java:38:
first defined here
/usr/bin/ld: Warning: size of symbol `java::lang::Throwable::getMessage(void)'
changed from 17 to 13 in java/lang/natThrowable.lo
collect2: ld returned 1 exit status

gchj is creating an inline definition of getMessage() and for some reason the
symbol for that method is showing up in both natThrowable.lo and Throwable.lo

The fix seems to be to remove the `#pragma implementation "Throwable.h"' from
natThrowable.cc. Is this the right thing to do?

  [ bryce ]



===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natThrowable.cc,v
retrieving revision 1.2
diff -u -r1.2 natThrowable.cc
--- natThrowable.cc     2000/01/18 06:22:13     1.2
+++ natThrowable.cc     2000/01/19 04:35:39
@@ -17,8 +17,6 @@

 #include <string.h>

-#pragma implementation "Throwable.h"
-
 #include <gcj/cni.h>
 #include <jvm.h>
 #include <java/lang/Object.h>





More information about the Java-patches mailing list