This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: finding libgcj
- To: "George Lawton" <gwlawton at email dot msn dot com>
- Subject: Re: finding libgcj
- From: Tom Tromey <tromey at cygnus dot com>
- Date: Wed, 2 Feb 2000 14:04:41 -0800 (PST)
- Cc: <java-discuss at sourceware dot cygnus dot com>
- References: <000c01bf6dc0$357260e0$695d153f@george>
>>>>> "George" == George Lawton <gwlawton@email.msn.com> writes:
George> ./HelloWorld: error in loading shared libraries: libgcj.so.o: cannot open
George> shared object file: No such file or directory
George> libgcj.so.0 is there (as a link to libgcj.so.0.0.0.) I've
George> tried several "obvious" things including environmental
George> variables (LD_RUN_PATH, LD_LIBRARY_PATH) and several different
George> compiler and linker flags but I can't get HelloWorld to find
George> the library.
LD_LIBRARY_PATH works for me.
It ought to work for you too.
creche. gcj --main=HelloWorld -o HelloWorld HelloWorld.java
creche. ./HelloWorld
./HelloWorld: error in loading shared libraries
libgcj.so.1: cannot open shared object file: No such file or directory
creche. LD_LIBRARY_PATH=/x1/egcs/install/lib ./HelloWorld
Hello World!
(I configured both packages with --prefix=/x1/egcs/install)
Otherwise you can try use -rpath when you compile:
creche. gcj --main=HelloWorld -o HelloWorld HelloWorld.java -Wl,-rpath,/x1/egcs/install/lib
creche. ./HelloWorld
Hello World!
Or you can add /usr/local/lib to your ld.so cache using ldconfig.
Or you can link statically, though this doesn't always work.
Tom