This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin 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]

Re: gcj and -mno-cygwin


Just gotten -mno-cygwin to work with gcj, don't know if someone's interested.

First of all get the latest gcc and gcc-mingw packages any cygwin mirror.
If it already works... well... it works!
If is doesn't and you get something like:

  $ gcj -mno-cygwin --main=HelloWorld -o HelloWorld.exe HelloWorld.java
  gcj: installation problem, cannot exec `jc1': No such file or directory

You have to create symbolic links to jc1.exe and jvgenmain.exe in /usr/lib/gcc-lib/i686-pc-mingw32/3.2/ which point to ../../i686-pc-cygwin/3.2/
Do it this way:

  $ cd /usr/lib/gcc-lib/i686-pc-mingw32/3.2
  $ ln -s ../../i686-pc-cygwin/3.2/jc1.exe
  $ ln -s ../../i686-pc-cygwin/3.2/jvgenmain.exe

You can try it again now, but you'll probably get a lot of undefined references when compiling HelloWorld.java with -mno-cygwin:

  $ gcj -mno-cygwin --main=HelloWorld -o HelloWorld.exe HelloWorld.java
  /usr/lib/gcc-lib/i686-pc-mingw32/3.2/../../../libgcj.a(prims.o)(.text+0x517): undefined reference to `_impure_ptr'
  /usr/lib/gcc-lib/i686-pc-mingw32/3.2/../../../libgcj.a(posix.o)(.text+0x23): undefined reference to `gettimeofday'
  /usr/lib/gcc-lib/i686-pc-mingw32/3.2/../../../libgcj.a(posix.o)(.text+0x7a): undefined reference to `sigemptyset'
  ...

What you need now is the MinGW port of libgcj, which you can get from the MinGW's Sourceforge project hosted at:

  http://sourceforge.net/project/showfiles.php?group_id=2435
  http://mingw.org -> for more on MinGW

Download the latest gcj binaries, which are probably still listed under "release candidates" the type is ".gz"
Unpack them to some temporary directory and then copy the following files (assuming you unpacked to the current directory):

  $ cp lib/libgcj.* /lib/mingw

Try yet again now, and hopefully it will work! You can now remove all the temporary files.

                  Nuno Cruces



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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