public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem linking java program
@ 2005-11-10 13:06 Julien Claassen
  2005-11-10 13:15 ` Michael Koch
  2005-11-10 13:20 ` Mark Wielaard
  0 siblings, 2 replies; 9+ messages in thread
From: Julien Claassen @ 2005-11-10 13:06 UTC (permalink / raw)
  To: gcc-help; +Cc: java

Hello all!
  I wanted to compile a helloworld program with selfcompiled gcc-3.4.3 (see
below for more info). It had linking problems. Compile only works fine.
  The program was:
// Begin of Test.java

import java.lang.*;

class Test
{
	public static void main(String args[])
	{
		System.out.println("Hello world.\n");
	}
};

// EOF
  The gcj call and output was:
gcj Test.java

/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
  I tried gcc, which gave some additional info:
gcc Test.java

/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
/tmp/ccq72aMH.o: In function `Test::main(JArray<java::lang::String*>*)':
/tmp/ccq72aMH.o(.text+0x8): undefined reference to `java::lang::System::class$'
/tmp/ccq72aMH.o(.text+0x1b): undefined reference to `_Jv_InitClass'
/tmp/ccq72aMH.o(.text+0x28): undefined reference to `java::lang::System::class$'
/tmp/ccq72aMH.o(.text+0x2d): undefined reference to `_Jv_InitClass'
/tmp/ccq72aMH.o(.text+0x37): undefined reference to `java::lang::System::out'
/tmp/ccq72aMH.o: In function `Test::Test()':
/tmp/ccq72aMH.o(.text+0x5f): undefined reference to `java::lang::Object::Object()'
/tmp/ccq72aMH.o(.data+0x50): undefined reference to `java::lang::Object::finalize()'
/tmp/ccq72aMH.o(.data+0x54): undefined reference to `java::lang::Object::hashCode()'
/tmp/ccq72aMH.o(.data+0x58): undefined reference to `java::lang::Object::equals(java::lang::Object*)'
/tmp/ccq72aMH.o(.data+0x5c): undefined reference to `java::lang::Object::toString()'
/tmp/ccq72aMH.o(.data+0x60): undefined reference to `java::lang::Object::clone()'
/tmp/ccq72aMH.o(.data+0xa0): undefined reference to `vtable for java::lang::Class'
/tmp/ccq72aMH.o(.data+0xb4): undefined reference to `java::lang::Object::class$'
/tmp/ccq72aMH.o(.eh_frame+0x11): undefined reference to `__gcj_personality_v0'
collect2: ld returned 1 exit status
My gcc was compiled with this config:
gcc -v
Reading specs from /usr/local/gcc343/lib/gcc/i686-pc-linux-gnu/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --prefix=/usr/local/gcc343 --enable-threads=posix --enable-__cxa_atexit --enable-version-specific-runtime-libs --enable-languages=c,c++,f77,objc,java --enable-gather-detailed-mem-stats --enable-nls --with-included-gettext --enable-interpreter --enable-libgcj-multifile --with-x --enable-java-awt=xlib
Thread model: posix
gcc version 3.4.3
  I've got an i686 athlon (k7) machine with SuSE 8.1 glibc-2.2.5 (the crt1.o
is in that package).
  I looked into the crt1.o with nm, here's the small output:
nm /usr/lib/crt1.o

00000004 R _IO_stdin_used
00000000 D __data_start
         U __libc_start_main
         U _fini
00000000 R _fp_hw
         U _init
00000000 T _start
00000000 W data_start
         U main
  Can anyone help me? Did I forget to install/update something? How about
environment variables anything SPECIAL I need?
  Kindest regards and thanks for any help
            Julien

--------
Music was my first love and it will be my last (John Miles)

======== FIND MY WEB-PROJECT AT: ========
http://ltsb.sourceforge.net - the Linux TextBased Studio guide

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem linking java program
  2005-11-10 13:06 Problem linking java program Julien Claassen
@ 2005-11-10 13:15 ` Michael Koch
  2005-11-10 13:19   ` Julien Claassen
  2005-11-11  5:16   ` Ranjit Mathew
  2005-11-10 13:20 ` Mark Wielaard
  1 sibling, 2 replies; 9+ messages in thread
From: Michael Koch @ 2005-11-10 13:15 UTC (permalink / raw)
  To: Julien Claassen; +Cc: gcc-help, java

On Thu, Nov 10, 2005 at 02:06:34PM +0100, Julien Claassen wrote:
> Hello all!
>   I wanted to compile a helloworld program with selfcompiled gcc-3.4.3 (see
> below for more info). It had linking problems. Compile only works fine.
>   The program was:
> // Begin of Test.java
> 
> import java.lang.*;
> 
> class Test
> {
> 	public static void main(String args[])
> 	{
> 		System.out.println("Hello world.\n");
> 	}
> };
> 
> // EOF
>   The gcj call and output was:
> gcj Test.java
> 
> /usr/lib/crt1.o: In function `_start':
> /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
> collect2: ld returned 1 exit status
>   I tried gcc, which gave some additional info:
> gcc Test.java

use this:

gcj --main=Test Test.java -o test

That is all well described in the gcj documentation.


Cheers,
Michael
> 
> /usr/lib/crt1.o: In function `_start':
> /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
> /tmp/ccq72aMH.o: In function `Test::main(JArray<java::lang::String*>*)':
> /tmp/ccq72aMH.o(.text+0x8): undefined reference to `java::lang::System::class$'
> /tmp/ccq72aMH.o(.text+0x1b): undefined reference to `_Jv_InitClass'
> /tmp/ccq72aMH.o(.text+0x28): undefined reference to `java::lang::System::class$'
> /tmp/ccq72aMH.o(.text+0x2d): undefined reference to `_Jv_InitClass'
> /tmp/ccq72aMH.o(.text+0x37): undefined reference to `java::lang::System::out'
> /tmp/ccq72aMH.o: In function `Test::Test()':
> /tmp/ccq72aMH.o(.text+0x5f): undefined reference to `java::lang::Object::Object()'
> /tmp/ccq72aMH.o(.data+0x50): undefined reference to `java::lang::Object::finalize()'
> /tmp/ccq72aMH.o(.data+0x54): undefined reference to `java::lang::Object::hashCode()'
> /tmp/ccq72aMH.o(.data+0x58): undefined reference to `java::lang::Object::equals(java::lang::Object*)'
> /tmp/ccq72aMH.o(.data+0x5c): undefined reference to `java::lang::Object::toString()'
> /tmp/ccq72aMH.o(.data+0x60): undefined reference to `java::lang::Object::clone()'
> /tmp/ccq72aMH.o(.data+0xa0): undefined reference to `vtable for java::lang::Class'
> /tmp/ccq72aMH.o(.data+0xb4): undefined reference to `java::lang::Object::class$'
> /tmp/ccq72aMH.o(.eh_frame+0x11): undefined reference to `__gcj_personality_v0'
> collect2: ld returned 1 exit status
> My gcc was compiled with this config:
> gcc -v
> Reading specs from /usr/local/gcc343/lib/gcc/i686-pc-linux-gnu/3.4.3/specs
> Configured with: ../gcc-3.4.3/configure --prefix=/usr/local/gcc343 --enable-threads=posix --enable-__cxa_atexit --enable-version-specific-runtime-libs --enable-languages=c,c++,f77,objc,java --enable-gather-detailed-mem-stats --enable-nls --with-included-gettext --enable-interpreter --enable-libgcj-multifile --with-x --enable-java-awt=xlib
> Thread model: posix
> gcc version 3.4.3
>   I've got an i686 athlon (k7) machine with SuSE 8.1 glibc-2.2.5 (the crt1.o
> is in that package).
>   I looked into the crt1.o with nm, here's the small output:
> nm /usr/lib/crt1.o
> 
> 00000004 R _IO_stdin_used
> 00000000 D __data_start
>          U __libc_start_main
>          U _fini
> 00000000 R _fp_hw
>          U _init
> 00000000 T _start
> 00000000 W data_start
>          U main
>   Can anyone help me? Did I forget to install/update something? How about
> environment variables anything SPECIAL I need?
>   Kindest regards and thanks for any help
>             Julien
> 
> --------
> Music was my first love and it will be my last (John Miles)
> 
> ======== FIND MY WEB-PROJECT AT: ========
> http://ltsb.sourceforge.net - the Linux TextBased Studio guide
> 

-- 
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html

Join the community at http://planet.classpath.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem linking java program
  2005-11-10 13:15 ` Michael Koch
@ 2005-11-10 13:19   ` Julien Claassen
  2005-11-10 13:26     ` Mark Wielaard
  2005-11-10 13:27     ` Michael Koch
  2005-11-11  5:16   ` Ranjit Mathew
  1 sibling, 2 replies; 9+ messages in thread
From: Julien Claassen @ 2005-11-10 13:19 UTC (permalink / raw)
  To: Michael Koch; +Cc: gcc-help, java

In Nov 10 A.D. 2005 Michael Koch scripsit:

> On Thu, Nov 10, 2005 at 02:06:34PM +0100, Julien Claassen wrote:
> > Hello all!
> >   I wanted to compile a helloworld program with selfcompiled gcc-3.4.3 (see
> > below for more info). It had linking problems. Compile only works fine.
> >   The program was:
> > // Begin of Test.java
> >
> > import java.lang.*;
> >
> > class Test
> > {
> > 	public static void main(String args[])
> > 	{
> > 		System.out.println("Hello world.\n");
> > 	}
> > };
> >
> > // EOF
> >   The gcj call and output was:
> > gcj Test.java
> >
> > /usr/lib/crt1.o: In function `_start':
> > /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
> > collect2: ld returned 1 exit status
> >   I tried gcc, which gave some additional info:
> > gcc Test.java
>
> use this:
>
> gcj --main=Test Test.java -o test
  Will
gcj --main=Test -c Test.java
  Then generate code, that can be interpreted with gij?
  Thanks for this solution so far!
  Kindest regards
          Julien
>
> That is all well described in the gcj documentation.
>
>
> Cheers,
> Michael
> >
> > /usr/lib/crt1.o: In function `_start':
> > /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
> > /tmp/ccq72aMH.o: In function `Test::main(JArray<java::lang::String*>*)':
> > /tmp/ccq72aMH.o(.text+0x8): undefined reference to `java::lang::System::class$'
> > /tmp/ccq72aMH.o(.text+0x1b): undefined reference to `_Jv_InitClass'
> > /tmp/ccq72aMH.o(.text+0x28): undefined reference to `java::lang::System::class$'
> > /tmp/ccq72aMH.o(.text+0x2d): undefined reference to `_Jv_InitClass'
> > /tmp/ccq72aMH.o(.text+0x37): undefined reference to `java::lang::System::out'
> > /tmp/ccq72aMH.o: In function `Test::Test()':
> > /tmp/ccq72aMH.o(.text+0x5f): undefined reference to `java::lang::Object::Object()'
> > /tmp/ccq72aMH.o(.data+0x50): undefined reference to `java::lang::Object::finalize()'
> > /tmp/ccq72aMH.o(.data+0x54): undefined reference to `java::lang::Object::hashCode()'
> > /tmp/ccq72aMH.o(.data+0x58): undefined reference to `java::lang::Object::equals(java::lang::Object*)'
> > /tmp/ccq72aMH.o(.data+0x5c): undefined reference to `java::lang::Object::toString()'
> > /tmp/ccq72aMH.o(.data+0x60): undefined reference to `java::lang::Object::clone()'
> > /tmp/ccq72aMH.o(.data+0xa0): undefined reference to `vtable for java::lang::Class'
> > /tmp/ccq72aMH.o(.data+0xb4): undefined reference to `java::lang::Object::class$'
> > /tmp/ccq72aMH.o(.eh_frame+0x11): undefined reference to `__gcj_personality_v0'
> > collect2: ld returned 1 exit status
> > My gcc was compiled with this config:
> > gcc -v
> > Reading specs from /usr/local/gcc343/lib/gcc/i686-pc-linux-gnu/3.4.3/specs
> > Configured with: ../gcc-3.4.3/configure --prefix=/usr/local/gcc343 --enable-threads=posix --enable-__cxa_atexit --enable-version-specific-runtime-libs --enable-languages=c,c++,f77,objc,java --enable-gather-detailed-mem-stats --enable-nls --with-included-gettext --enable-interpreter --enable-libgcj-multifile --with-x --enable-java-awt=xlib
> > Thread model: posix
> > gcc version 3.4.3
> >   I've got an i686 athlon (k7) machine with SuSE 8.1 glibc-2.2.5 (the crt1.o
> > is in that package).
> >   I looked into the crt1.o with nm, here's the small output:
> > nm /usr/lib/crt1.o
> >
> > 00000004 R _IO_stdin_used
> > 00000000 D __data_start
> >          U __libc_start_main
> >          U _fini
> > 00000000 R _fp_hw
> >          U _init
> > 00000000 T _start
> > 00000000 W data_start
> >          U main
> >   Can anyone help me? Did I forget to install/update something? How about
> > environment variables anything SPECIAL I need?
> >   Kindest regards and thanks for any help
> >             Julien
> >
> > --------
> > Music was my first love and it will be my last (John Miles)
> >
> > ======== FIND MY WEB-PROJECT AT: ========
> > http://ltsb.sourceforge.net - the Linux TextBased Studio guide
> >
>
> --
> Escape the Java Trap with GNU Classpath!
> http://www.gnu.org/philosophy/java-trap.html
>
> Join the community at http://planet.classpath.org/
>

--------
Music was my first love and it will be my last (John Miles)

======== FIND MY WEB-PROJECT AT: ========
http://ltsb.sourceforge.net - the Linux TextBased Studio guide

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem linking java program
  2005-11-10 13:06 Problem linking java program Julien Claassen
  2005-11-10 13:15 ` Michael Koch
@ 2005-11-10 13:20 ` Mark Wielaard
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Wielaard @ 2005-11-10 13:20 UTC (permalink / raw)
  To: Julien Claassen; +Cc: gcc-help, java

[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]

On Thu, 2005-11-10 at 14:06 +0100, Julien Claassen wrote:
> Hello all!
>   I wanted to compile a helloworld program with selfcompiled gcc-3.4.3 (see
> below for more info). It had linking problems. Compile only works fine.
>   The program was:
> // Begin of Test.java
> 
> import java.lang.*;
> 
> class Test
> {
> 	public static void main(String args[])
> 	{
> 		System.out.println("Hello world.\n");
> 	}
> };
> 
> // EOF
>   The gcj call and output was:
> gcj Test.java
> 
> /usr/lib/crt1.o: In function `_start':
> /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
> collect2: ld returned 1 exit status

When generating an executable you need it to tell which class is the
main class: gcj --main=Test Test.java
The resulting a.out executable will then start executing your program
using Test.main().

See also http://gcc.gnu.org/onlinedocs/gcj/Linking.html#Linking

Cheers,

Mark

-- 
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html

Join the community at http://planet.classpath.org/

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem linking java program
  2005-11-10 13:19   ` Julien Claassen
@ 2005-11-10 13:26     ` Mark Wielaard
  2005-11-10 13:27     ` Michael Koch
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Wielaard @ 2005-11-10 13:26 UTC (permalink / raw)
  To: Julien Claassen; +Cc: Michael Koch, gcc-help, java

[-- Attachment #1: Type: text/plain, Size: 814 bytes --]

Hi Julian,

On Thu, 2005-11-10 at 14:19 +0100, Julien Claassen wrote:
> In Nov 10 A.D. 2005 Michael Koch scripsit:
> > use this:
> >
> > gcj --main=Test Test.java -o test
>   Will
> gcj --main=Test -c Test.java
>   Then generate code, that can be interpreted with gij?

No, not directly If you want to produce byte code then use the -C
option. See http://gcc.gnu.org/onlinedocs/gcj/Code-Generation.html

You can get gij to use the generated precompiled object code if you turn
it into a shared library and register it with the system wide gcj/gij
class database.
See http://gcc.gnu.org/onlinedocs/gcj/Invoking-gcj_002ddbtool.html

Cheers,

Mark
-- 
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html

Join the community at http://planet.classpath.org/

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem linking java program
  2005-11-10 13:19   ` Julien Claassen
  2005-11-10 13:26     ` Mark Wielaard
@ 2005-11-10 13:27     ` Michael Koch
  2005-11-10 13:34       ` Julien Claassen
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Koch @ 2005-11-10 13:27 UTC (permalink / raw)
  To: Julien Claassen; +Cc: gcc-help, java

On Thu, Nov 10, 2005 at 02:19:19PM +0100, Julien Claassen wrote:
> In Nov 10 A.D. 2005 Michael Koch scripsit:
> 
> > On Thu, Nov 10, 2005 at 02:06:34PM +0100, Julien Claassen wrote:
> > > Hello all!
> > >   I wanted to compile a helloworld program with selfcompiled gcc-3.4.3 (see
> > > below for more info). It had linking problems. Compile only works fine.
> > >   The program was:
> > > // Begin of Test.java
> > >
> > > import java.lang.*;
> > >
> > > class Test
> > > {
> > > 	public static void main(String args[])
> > > 	{
> > > 		System.out.println("Hello world.\n");
> > > 	}
> > > };
> > >
> > > // EOF
> > >   The gcj call and output was:
> > > gcj Test.java
> > >
> > > /usr/lib/crt1.o: In function `_start':
> > > /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
> > > collect2: ld returned 1 exit status
> > >   I tried gcc, which gave some additional info:
> > > gcc Test.java
> >
> > use this:
> >
> > gcj --main=Test Test.java -o test
>   Will
> gcj --main=Test -c Test.java
>   Then generate code, that can be interpreted with gij?
>   Thanks for this solution so far!

No. -c generated native code, -C generates bytecode. gcj is not
commandline compatible to javac.


Cheers,
Michael

>   Kindest regards
>           Julien
> >
> > That is all well described in the gcj documentation.
> >
> >
> > Cheers,
> > Michael
> > >
> > > /usr/lib/crt1.o: In function `_start':
> > > /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
> > > /tmp/ccq72aMH.o: In function `Test::main(JArray<java::lang::String*>*)':
> > > /tmp/ccq72aMH.o(.text+0x8): undefined reference to `java::lang::System::class$'
> > > /tmp/ccq72aMH.o(.text+0x1b): undefined reference to `_Jv_InitClass'
> > > /tmp/ccq72aMH.o(.text+0x28): undefined reference to `java::lang::System::class$'
> > > /tmp/ccq72aMH.o(.text+0x2d): undefined reference to `_Jv_InitClass'
> > > /tmp/ccq72aMH.o(.text+0x37): undefined reference to `java::lang::System::out'
> > > /tmp/ccq72aMH.o: In function `Test::Test()':
> > > /tmp/ccq72aMH.o(.text+0x5f): undefined reference to `java::lang::Object::Object()'
> > > /tmp/ccq72aMH.o(.data+0x50): undefined reference to `java::lang::Object::finalize()'
> > > /tmp/ccq72aMH.o(.data+0x54): undefined reference to `java::lang::Object::hashCode()'
> > > /tmp/ccq72aMH.o(.data+0x58): undefined reference to `java::lang::Object::equals(java::lang::Object*)'
> > > /tmp/ccq72aMH.o(.data+0x5c): undefined reference to `java::lang::Object::toString()'
> > > /tmp/ccq72aMH.o(.data+0x60): undefined reference to `java::lang::Object::clone()'
> > > /tmp/ccq72aMH.o(.data+0xa0): undefined reference to `vtable for java::lang::Class'
> > > /tmp/ccq72aMH.o(.data+0xb4): undefined reference to `java::lang::Object::class$'
> > > /tmp/ccq72aMH.o(.eh_frame+0x11): undefined reference to `__gcj_personality_v0'
> > > collect2: ld returned 1 exit status
> > > My gcc was compiled with this config:
> > > gcc -v
> > > Reading specs from /usr/local/gcc343/lib/gcc/i686-pc-linux-gnu/3.4.3/specs
> > > Configured with: ../gcc-3.4.3/configure --prefix=/usr/local/gcc343 --enable-threads=posix --enable-__cxa_atexit --enable-version-specific-runtime-libs --enable-languages=c,c++,f77,objc,java --enable-gather-detailed-mem-stats --enable-nls --with-included-gettext --enable-interpreter --enable-libgcj-multifile --with-x --enable-java-awt=xlib
> > > Thread model: posix
> > > gcc version 3.4.3
> > >   I've got an i686 athlon (k7) machine with SuSE 8.1 glibc-2.2.5 (the crt1.o
> > > is in that package).
> > >   I looked into the crt1.o with nm, here's the small output:
> > > nm /usr/lib/crt1.o
> > >
> > > 00000004 R _IO_stdin_used
> > > 00000000 D __data_start
> > >          U __libc_start_main
> > >          U _fini
> > > 00000000 R _fp_hw
> > >          U _init
> > > 00000000 T _start
> > > 00000000 W data_start
> > >          U main
> > >   Can anyone help me? Did I forget to install/update something? How about
> > > environment variables anything SPECIAL I need?
> > >   Kindest regards and thanks for any help
> > >             Julien
> > >
> > > --------
> > > Music was my first love and it will be my last (John Miles)
> > >
> > > ======== FIND MY WEB-PROJECT AT: ========
> > > http://ltsb.sourceforge.net - the Linux TextBased Studio guide
> > >
> >
> > --
> > Escape the Java Trap with GNU Classpath!
> > http://www.gnu.org/philosophy/java-trap.html
> >
> > Join the community at http://planet.classpath.org/
> >
> 
> --------
> Music was my first love and it will be my last (John Miles)
> 
> ======== FIND MY WEB-PROJECT AT: ========
> http://ltsb.sourceforge.net - the Linux TextBased Studio guide
> 

-- 
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html

Join the community at http://planet.classpath.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem linking java program
  2005-11-10 13:27     ` Michael Koch
@ 2005-11-10 13:34       ` Julien Claassen
  0 siblings, 0 replies; 9+ messages in thread
From: Julien Claassen @ 2005-11-10 13:34 UTC (permalink / raw)
  To: gcc-help; +Cc: java

Thanks very much! Both of you!
  Kindest regards
        Julien

--------
Music was my first love and it will be my last (John Miles)

======== FIND MY WEB-PROJECT AT: ========
http://ltsb.sourceforge.net - the Linux TextBased Studio guide

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem linking java program
  2005-11-10 13:15 ` Michael Koch
  2005-11-10 13:19   ` Julien Claassen
@ 2005-11-11  5:16   ` Ranjit Mathew
  2005-11-11 18:01     ` Chris Gray
  1 sibling, 1 reply; 9+ messages in thread
From: Ranjit Mathew @ 2005-11-11  5:16 UTC (permalink / raw)
  To: Michael Koch; +Cc: gcc-help, java

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Koch wrote:
> 
> use this:
> 
> gcj --main=Test Test.java -o test

Just as an aside, naming your executable as "test" can
cause unintended behaviour depending on your shell,
how you invoke the program and your PATH. You will
not notice it if you invoke it as "./test", but if
your PATH contains "." and you just say "test"...

Ranjit.

- --
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web: http://ranjitmathew.hostingzero.com/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDdCkrYb1hx2wRS48RAiLEAJ4qz9bcXNOVz8etoOa34uaxgV7F5wCgiMxf
iVRx6tPCrXoXwRkTPrTCtY0=
=wZkg
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem linking java program
  2005-11-11  5:16   ` Ranjit Mathew
@ 2005-11-11 18:01     ` Chris Gray
  0 siblings, 0 replies; 9+ messages in thread
From: Chris Gray @ 2005-11-11 18:01 UTC (permalink / raw)
  To: Ranjit Mathew, Michael Koch; +Cc: gcc-help, java

On Friday 11 November 2005 06:16, Ranjit Mathew wrote:

> Just as an aside, naming your executable as "test" can
> cause unintended behaviour depending on your shell,
> how you invoke the program and your PATH. You will
> not notice it if you invoke it as "./test", but if
> your PATH contains "." and you just say "test"...

Other names to be avoided for this reason include "function", "time", and not 
least" "exit". ;-)

Chris

-- 
Chris Gray        /k/ Embedded Java Solutions  BE0503765045
Embedded & Mobile Java, OSGi        http://www.kiffer.be/k/
chris.gray@kiffer.be                         +32 3 216 0369

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-11 18:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-10 13:06 Problem linking java program Julien Claassen
2005-11-10 13:15 ` Michael Koch
2005-11-10 13:19   ` Julien Claassen
2005-11-10 13:26     ` Mark Wielaard
2005-11-10 13:27     ` Michael Koch
2005-11-10 13:34       ` Julien Claassen
2005-11-11  5:16   ` Ranjit Mathew
2005-11-11 18:01     ` Chris Gray
2005-11-10 13:20 ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).