This is the mail archive of the cygwin 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: error during genaration of object code (ld cannot find -liconv)

Hello Alexey,

> my question is: if I try to run `gcj' without `-C' option then I get the
> error from ld:

> $cat

> /**
>  * The HelloWorldApp class implements an application that
>  * simply displays "Hello World!" to the standard output.
>  */
> class HelloWorldApp {
>     public static void main(String[] args) {
>         System.out.println("Hello World!"); //Display the string.
>     }
> }

> $ gcj

> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/ld:
> cannot find -liconv
> collect2: ld returned 1 exit status

> What does this mean? How to avoid the problem?
> Note: `$gcj -C' is Ok and generates HelloWorldApp.class.

You need to specify to gcj what it should do, obviously there is no
useful default setting.

If you specify `-C' the manpage says:

 -C  This option is used to tell gcj to generate bytecode (.class files)
           rather than object code.

I would expect that you get an error like this without specifying
$ gcj
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../libcygwin.a(libcmain.o)(.text+0x7a): undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status

Anyway, if you want to build an executable, you say like this:
  $ gcj --main=Foo -o Foo
and to get bytecode you say:
  $ gcj -C


Unsubscribe info:
Problem reports:

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