This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: undefined reference
On Tue, 2004-06-22 at 18:30, Ray Auge wrote:
> On Tue, 2004-06-22 at 17:45, marco@mherrn.de wrote:
> > Hi,
> >
> > > You need a binary version of the log4j package. Try doing it in steps
> > > instead:
> > > $ gcj -I. -I/usr/share/java/log4j-1.2.jar Test.java -o Test.o
> > > $ gcj -c /usr/share/java/log4j-1.2.jar -o log4j-1.2.o
> > > $ gcj --main=Test -o Test Test.o log4j1-1.2.o
> >
> > No, that still doesn't work. The first command already results in this:
> >
> I get the same error (with 3.4.0).
>
> [rotty@localhost jar-test]$ ls -l
> total 76
> -rw-rw-r-- 1 rotty rotty 66484 Jun 22 18:17 pLASTer.jar
> -rw-rw-r-- 1 rotty rotty 796 Jun 22 18:16 TestMapper.java
> [rotty@localhost jar-test]$ gcj -I. -I./pLASTer.jar TestMapper.java -o
> TestMapper.o
> /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.0/../../../crt1.o(.text+0x18):
> In function `_start':
> ../sysdeps/i386/elf/start.S:98: undefined reference to `main'
> /home/rotty/tmp/ccS5v8NP.o(.text+0x2a): In function
> `TestMapper::main(JArray<java::lang::String*>*)':
> : undefined reference to `last::map::Mapper::class$'
> /home/rotty/tmp/ccS5v8NP.o(.text+0x3d): In function
> `TestMapper::main(JArray<java::lang::String*>*)':
> : undefined reference to `last::map::Mapper::Mapper()'
> /home/rotty/tmp/ccS5v8NP.o(.text+0x68): In function
> `TestMapper::main(JArray<java::lang::String*>*)':
> : undefined reference to `last::map::FileSource::class$'
> /home/rotty/tmp/ccS5v8NP.o(.text+0x87): In function
> `TestMapper::main(JArray<java::lang::String*>*)':
> : undefined reference to
> `last::map::FileSource::FileSource(java::lang::String*,
> java::lang::String*)'
> collect2: ld returned 1 exit status
>
> Any ideas?
>
> > ----/----
> > /usr/lib/gcc-lib/i486-linux/3.3.4/../../../crt1.o(.text+0x18): In
> > function `_start':
> > ../sysdeps/i386/elf/start.S:98: undefined reference to `main'
> > /tmp/ccLchKTa.o(.text+0x23): In function `Test::Test[in-charge]()':
> > : undefined reference to `org::apache::log4j::Logger::getRootLogger()'
> > /tmp/ccLchKTa.o(.data+0x4): undefined reference to
> > `org::apache::log4j::Logger::class$'
> > collect2: ld returned 1 exit status
> > ----/----
> >
> > But I also thought that gcj could links agains class files. At least
> > that was my impression after reading the FAQ on the website.
> >
> > Marco
> > --
> > The more things change, the more they'll never be the same again
> > --
> > Marco Herrn _ ___ o ' (_)< _ _
> > _>(__'> o 0 (_X %
> > >(_`> O o _; _;'7^'_ \;\ %
> > (GnuPG/PGP-crypted mail preferred) _;\ _.\ _.';;) ;,;_/;
> > Key ID: 0x94620736 _ _'./_\('))_; );/\)}/`fsc
--
Ray Auge <rayauge@doublebite.com>
Make sure to visit http://plaster.sourceforge.net
to see what I've been up to.