[fedora-java] Re: ld doesn't know about location of libjvm

Braden McDaniel braden at endoframe.com
Sat Oct 28 17:50:12 UTC 2006


On Fri, 27 Oct 2006 11:12:35 +0100, Andrew Haley wrote:

> Braden McDaniel writes:
>  > ld seems not to know about /usr/lib[64]/gcj-4.1.1; and as such cannot 
>  > find libjvm.so without a -L flag. Is this deliberate or a bug?
> 
> Please post a test case that shows this fault.

On this Fedora Core 6 x86_64 system, this program

  #include <jni.h>

  int main()
  {
    JNI_CreateJavaVM(0, 0, 0);
  }

cannot be linked with this command line:

  $ gcc -ljvm -o libjvm-test libjvm_test.c
  /usr/bin/ld: cannot find -ljvm
  collect2: ld returned 1 exit status

This command line succeeds:

  $ gcc -L/usr/lib64/gcj-4.1.1 -ljvm -o libjvm-test libjvm_test.c

-- 
Braden McDaniel                           e-mail: <braden at endoframe.com>
<http://endoframe.com>                    Jabber: <braden at jabber.org>




More information about the fedora-devel-java-list mailing list