Re: error while loading shared libraries: libgfortran.so.3: wrong ELF class: ELFCLASS32
|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]|
Dear Jonathan For the sake of building static libraries I tried to configure with option --disable-shared. But that was not successful. And now even the previous build is not working. I have cleaned the source directory again and tried a new configure without any flag. But it is giving following error here=`pwd`; cd /home/pmdtest/gcc-4.6.1/libjava/classpath/lib; \ find gnu java javax org sun -name .svn -prune -o -name '*.class' -print | \ gjar -cfM@ $here/libgcj-4.6.1.jar Exception in thread "main" java.lang.ExceptionInInitializerError *** Got java.lang.NullPointerException while trying to print stack trace. make: *** [libgcj-4.6.1.jar] Error 1 make: Leaving directory `/home/pmdtest/objdir/x86_64-unknown-linux-gnu/32/libjava' make: *** [all-recursive] Error 1 make: Leaving directory `/home/pmdtest/objdir/x86_64-unknown-linux-gnu/32/libjava' make: *** [multi-do] Error 1 make: Leaving directory `/home/pmdtest/objdir/x86_64-unknown-linux-gnu/libjava' make: *** [all-multi] Error 2 make: Leaving directory `/home/pmdtest/objdir/x86_64-unknown-linux-gnu/libjava' make: *** [all-target-libjava] Error 2 make: Leaving directory `/home/pmdtest/objdir' make: *** [all] Error 2 Regards On Wed, Jun 20, 2012 at 4:50 PM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote: > On 20 June 2012 11:53, Syed Ahsan Ali Bokhari <ahsan.pmd@xxxxxxxxx> wrote: >> The page says that >> At runtime set LD_LIBRARY_PATH in your environment correctly, so that >> the shared library for libstdc++ can be found and loaded. Be certain >> that you understand all of the other implications and behavior of >> LD_LIBRARY_PATH first. >> >> I have set LD_LIBRARY_PATH already in bashrc. Does it serves the purpose? > > It depends what you've set it to and whether you've exported it. > > If you've set it to destdir/lib that would explain the error, you > probably need it to be destdir/lib64 > > >> Compile the path to find the library at runtime into the program. This >> can be done by passing certain options to g++, which will in turn pass >> them on to the linker. The exact format of the options is dependent on >> which linker you use: >> >> GNU ld (default on GNU/Linux): -Wl,-rpath,destdir/lib >> >> I can't understand this option. Can you explain a little please > > Read the manuals. > > -Wl, tells GCC to pass the following options to the linker, replacing > commas with spaces. > > -rpath destdir/lib tells the linker to add a RT_RPATH or DT_RUNPATH > entry with the contents destdir/lib, you should replace "destdir/lib" > with the location of the shared library the executable needs.