This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

RE: libgcj/2737: User-defined thrown exception is not found


> >>>>> "Jeff" == jddahl  <jddahl@micron.com> writes:
> 
> Jeff> Maybe I'm approaching this wrong.  Is it possible to create a
> Jeff> class, compile down to a .o file and continue building .o's that
> Jeff> inherit or import that .o, and continue in that fashion (much
> Jeff> like building packages with javac) or do you skip the .o stage
> Jeff> all together and go from many .java's to one compiled
> Jeff> executable?
> 
> Jeff> I am running into problems after building my .o's and trying to
> Jeff> compile them together, but not when I compile all .java's into
> Jeff> one executable.
> 
> That isn't what you've reported.  What you've reported is a problem
> with compiling to .o which I believe arises due to an incorrect
> specification of the class path.
> 
> Did you try the -I option I suggested?

True, this is not what I originally reported.  My original problem was fixed
by including the exception's .java in the list of prerequisites and
specifying the -c option.  But now I have three .o files and can't figure
out how to combine them into one executable.

> You can compile each .java file to a separate .o and then link, just
> like you would with C.

When I execute:
gcj -o test Test.o /u/jddahl/java/objects_solaris/test/core/LotNumber.o
/u/jddahl/java/objects_solaris/test/core/InitializationException.o

I get the following error:
ld: fatal: symbol `test::core::InitializationException::class$   ' is
multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `test::core::LotNumber::LotNumber(java::lang::String*)' is
multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol
`test::core::InitializationException::InitializationException(java::lang::St
ring*)' is multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `test::core::LotNumber::getTravelerID()  ' is multiply
defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `vtable for test::core::LotNumber' is multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `test::core::LotNumber::pathFormat(int)' is multiply
defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `test::core::LotNumber::fileFormat()  ' is multiply
defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `vtable for test::core::InitializationException' is
multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `test::core::LotNumber::getTravelerExt()  ' is multiply
defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `test::core::LotNumber::toString() ' is multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `test::core::LotNumber::pathFormat(java::lang::String*)  '
is multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `test::core::LotNumber::slashFormat()  ' is multiply
defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `test::core::LotNumber::class$  ' is multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol
`test::core::InitializationException::InitializationException()' is multiply
defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/LotNumber.o);
ld: fatal: symbol `test::core::InitializationException::class$   ' is
multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/InitializationException.o);
ld: fatal: symbol
`test::core::InitializationException::InitializationException(java::lang::St
ring*)' is multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/InitializationException.o);
ld: fatal: symbol `vtable for test::core::InitializationException' is
multiply defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/InitializationException.o);
ld: fatal: symbol
`test::core::InitializationException::InitializationException()' is multiply
defined:
        (file Test.o and file
/u/jddahl/java/objects_solaris/test/core/InitializationException.o);
ld: fatal: File processing errors. No output written to test
collect2: ld returned 1 exit status

It's almost as if I need to include the #ifndef preprocessor directive.

Thanks,
Jeff


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