K
KevJohnP
Hi
For various reasons, we have a need to compile some small java utility
applications into simple windows executables. To achieve this we have
been looking at using GNU GCJ.
We have now got this setup using cygwin on Windows and can compile to an
exe. However if we try to use the compilation option -mno-cygwin (such
that the .exe will not require the cygwin1.dll file on our target
machines) then this fails. Compiling C programs with gcc seems fine, so
it appears to be a gcj / mingw problem (as I believe it is mingw which
is used when -mno-cygwin is used).
Anyone have any ideas?? HelloWorld example below (compiles OK under jdk).
Thanks
KJP
$ cat HelloWorld.java
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
$ gcj --main=HelloWorld HelloWorld.java -o hello -mno-cygwin
/usr/lib/gcc-lib/i686-pc-mingw32/3.3.1/../../../libgcj.a(prims.o)(.text+0x607):
undefined reference to `___getreent'
/usr/lib/gcc-lib/i686-pc-mingw32/3.3.1/../../../libgcj.a(natRuntime.o)(.text+0x852):
undefined reference to `_nl_langinfo'
/usr/lib/gcc-lib/i686-pc-mingw32/3.3.1/../../../libgcj.a(natRuntime.o)(.text+0x110a):
undefined reference to `_uname'
<snip>
<and so on ...>
/usr/lib/gcc-lib/i686-pc-mingw32/3.3.1/../../../libgcj.a(natSocketChannelImpl.o)(.text+0x36e):
undefined reference to `___errno'
collect2: ld returned 1 exit status
For various reasons, we have a need to compile some small java utility
applications into simple windows executables. To achieve this we have
been looking at using GNU GCJ.
We have now got this setup using cygwin on Windows and can compile to an
exe. However if we try to use the compilation option -mno-cygwin (such
that the .exe will not require the cygwin1.dll file on our target
machines) then this fails. Compiling C programs with gcc seems fine, so
it appears to be a gcj / mingw problem (as I believe it is mingw which
is used when -mno-cygwin is used).
Anyone have any ideas?? HelloWorld example below (compiles OK under jdk).
Thanks
KJP
$ cat HelloWorld.java
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
$ gcj --main=HelloWorld HelloWorld.java -o hello -mno-cygwin
/usr/lib/gcc-lib/i686-pc-mingw32/3.3.1/../../../libgcj.a(prims.o)(.text+0x607):
undefined reference to `___getreent'
/usr/lib/gcc-lib/i686-pc-mingw32/3.3.1/../../../libgcj.a(natRuntime.o)(.text+0x852):
undefined reference to `_nl_langinfo'
/usr/lib/gcc-lib/i686-pc-mingw32/3.3.1/../../../libgcj.a(natRuntime.o)(.text+0x110a):
undefined reference to `_uname'
<snip>
<and so on ...>
/usr/lib/gcc-lib/i686-pc-mingw32/3.3.1/../../../libgcj.a(natSocketChannelImpl.o)(.text+0x36e):
undefined reference to `___errno'
collect2: ld returned 1 exit status