This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

Re: Link problem with gcj


> Date: Fri, 20 Aug 1999 15:46:40 +0200
> From: "b.d. vrijkorte" <bd.vrijkorte@signaal.nl>
> 
> Hello,
> 
> when I compile a 'Hello world' java-program using gcj I get an ld error
> (see below).
> I have installed:
> - gcc 2.95.1
> - binutils 2.9.1.0.25
> - libstdc++-2.90.6
> - libgcj-2.95
> 
> A 'Hello world' program using gcc compiles and works correctly.
> 
> Who can tell me what's wrong? 

Unlike C, which can only have one function called main(), every Java
class can have a method main(), so You have to tell gcj which class to
start.  What you need is

gcj test.java --main=test

Andrew.

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