This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 3.1 -- Sparc64 Solaris 8 and C++
On Tue, May 28, 2002 at 04:40:15PM -0400, Brad House wrote:
> ahh, didn't realize that the sparcv9 directory was for 64 bit ...
> makes sense though.
>
> setting LD_LIBRARY_PATH_64 fixed the problem ... thanks ...
>
> BTW, why doesn't GCC know to look where it installed them
> by default??
It does. However, it's not the compiler's responsibility to set the
default run-time search path. Look at ld.so.1(1) for how you can set
this on the system. Or, use -R[path to sparcv9 directory] for how you
can embed it into the executable.
> -Brad
>
> Albert Chin wrote:
> > On Tue, May 28, 2002 at 01:31:30PM -0400, Brad House wrote:
> >
> >>I compiled GCC 3.1 on Solaris 8 using GCC 2.95.3
> >>and the Solaris 8 default as and ld, not GNU binutils.
> >>
> >>Apparently a 64bit version of libstdc++ and libgcc_s
> >>were not created at build time, so when I have a test
> >>program:
> >>
> >>#include <stdio.h>
> >>int main() { printf("hello world!\n"); return(0); }
> >>
> >>and force the C++ compiler to compile it (yes I know
> >>it's C code) in 64bit:
> >>
> >>g++ -m64 -o test test.c
> >>
> >>I get this when I run it:
> >>
> >># ./test
> >>ld.so.1: ./test: fatal: /usr/local/gcc/lib/libstdc++.so.4: wrong ELF
> >>class: ELFCLASS32
> >>Killed
> >
> >
> > I get the following error (on Solaris 7):
> > $ ./a.out
> > ld.so.1: ./a.out: fatal: libstdc++.so.4: open failed: No such file
> > or directory
> >
> > I solved this with:
> > $ g++ -m64 -R[path to gcc31]/lib/sparcv9 test.c
> >
> > Do you have LD_LIBRARY_PATH or LD_LIBRARY_PATH_64 set?
> >
>
--
albert chin (china@thewrittenword.com)