GCJ Problem

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top