This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
natThrowable.lo multiple definition error
- To: java-patches at sourceware dot cygnus dot com
- Subject: natThrowable.lo multiple definition error
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Wed, 19 Jan 2000 17:54:34 +1300
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>