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]

undefined reference


Hi,

I am trying out gcj to compile java code to native binaries.
I have written a very minimalistic test code:

------/-------
import org.apache.log4j.Logger;

class Test{
    Logger logger;

    public Test(){
        logger= Logger.getRootLogger();
        System.out.println(logger);
    }

    public static void main(String[] args){
        Test test= new Test();
    }//main()
}//Test
------/-------

When trying to compile this with:
    gcj --main=Test --classpath=.:/usr/share/java/log4j-1.2.jar Test.java
I get the following  error message:

------/-------
/tmp/ccGtPlNJ.o(.text+0x54): In function `Test::Test[in-charge]()':
: undefined reference to `org::apache::log4j::Logger::getRootLogger()'
/tmp/ccGtPlNJ.o(.data+0x4): undefined reference to `org::apache::log4j::Logger::class$'
collect2: ld returned 1 exit status
------/-------

Compiling it with jikes works:
   jikes-kaffe -classpath .:/usr/share/java/log4j-1.2.jar Test.java


I am using gcj 3.3.4 under Debian sid.

Any ideas where the problem is?

Marco

-- 
You plan things that you do not even attempt because of your extreme caution.
--
Marco Herrn              _  ___      o             '       (_)<   _ _
                         _>(__'>            o          0         (_X %
                                   >(_`>  O         o  _; _;'7^'_ \;\ %
(GnuPG/PGP-crypted mail preferred)         _;\ _.\ _.';;) ;,;_/;
Key ID: 0x94620736                  _  _'./_\('))_; );/\)}/`fsc


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