This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Multiply defined symbols building libgcj


On 30 May 2003, Craig A. Vanderborgh wrote:
> zetar% arm-wince-pe-gcj --main=HelloWorld HelloWorld.java -lgcj -lc -lgcc -lwinsock -lcoredll
> /usr/local/wince/lib/gcc-lib/arm-wince-pe/3.3/../../../../arm-wince-pe/lib/libgcj.a(String.o)(.text+0x4fc): In function `_ZN4java4lang6String6lengthEv':
> /a/gnu/cross-gcc-build-arm/gcc/libgcj/../../../gcc-3.3/libjava/java/lang/String.java:194: multiple definition of `java::lang::String::length()'
> /usr/local/wince/lib/gcc-lib/arm-wince-pe/3.3/../../../../arm-wince-pe/lib/libgcj.a(prims.o)(.text$_ZN4java4lang6String6lengthEv+0x0):/a/gnu/cross-gcc-build-arm/gcc/libgcj/../../../gcc-3.3/libjava/java/lang/Class.h: first defined here

Ick.  This sort of failure happens all too often on targets without weak
pointer support.

Did you perhaps build libjava without optimization (i.e. CPPFLAGS = -g)?
Sometimes that causes methods that would otherwise be inlined to be
generated instead.  (Even so, the "#pragma interface" directive in
header files ought to prevent that.)

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]