public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
@ 2006-12-06 15:01 Rohit Arul Raj
  2006-12-06 15:30 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Rohit Arul Raj @ 2006-12-06 15:01 UTC (permalink / raw)
  To: gcc-help

Hi all,

I build a native C++ compiler - version 4.1.1.
I then tried to execute a simple hello world C++ program.

when compiled with g++,
it gives me the following error:

./a.out: error while loading shared libraries: libstdc++.so.6: cannot
open shared object file: No such file or directory

but when i use the command line driver $gcc 1.cpp
i get the following errors.

/tmp/cc2wk6Uk.o(.text+0x23): In function `__static_initialization_and_destructio
n_0(int, int)':
: undefined reference to `std::ios_base::Init::Init()'
/tmp/cc2wk6Uk.o(.text+0x3e): In function `__static_initialization_and_destructio
n_0(int, int)':
: undefined reference to `std::ios_base::Init::~Init()'
/tmp/cc2wk6Uk.o(.text+0x90): In function `main':
: undefined reference to `std::cout'
/tmp/cc2wk6Uk.o(.text+0x95): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std
::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits
<char> >&, char const*)'
/tmp/cc2wk6Uk.o(.text+0x9d): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std
::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<
char> >&)'
/tmp/cc2wk6Uk.o(.text+0xa5): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >::ope
rator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostrea
m<char, std::char_traits<char> >&))'
/tmp/cc2wk6Uk.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status


I did not have anyproblems while building the compiler.

Can any one tell me where i am going wrong!!!

Regards,
Rohit

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
  2006-12-06 15:01 error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory Rohit Arul Raj
@ 2006-12-06 15:30 ` Ian Lance Taylor
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Lance Taylor @ 2006-12-06 15:30 UTC (permalink / raw)
  To: Rohit Arul Raj; +Cc: gcc-help

"Rohit Arul Raj" <rohitarulraj@gmail.com> writes:

> I build a native C++ compiler - version 4.1.1.
> I then tried to execute a simple hello world C++ program.
> 
> when compiled with g++,
> it gives me the following error:
> 
> ./a.out: error while loading shared libraries: libstdc++.so.6: cannot
> open shared object file: No such file or directory

If you install libstdc++.so.6 in a non-standard location, you need to
tell the dynamic linker where to find it.  This can be done by setting
the environment variable LD_LIBRARY_PATH to the directory where
libstdc++.so.6 can be found.  Or by using -Wl,-rpath,DIR when you
link.  Or, on a GNU/Linux system, by adding the directory to
/etc/ld.so.conf and friends and running ldconfig.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
  2005-11-01  1:30 ` Noel Yap
@ 2005-11-01  4:59   ` Noel Yap
  0 siblings, 0 replies; 5+ messages in thread
From: Noel Yap @ 2005-11-01  4:59 UTC (permalink / raw)
  To: gcc-help

OK, I've given up on this since even if I were to be able to do this,
I'd have to do it for each library shipped with gcc.  It's much easier
just to add the appropriate linker flags at build time especially
since I'll probably have to do the same for each -L directory, anyway.

Noel

On 10/31/05, Noel Yap <noel.yap@gmail.com> wrote:
> OK, I read the FAQ and it says the following:
>
>   Yet another option, that works on a few platforms, is to hard-code
> the full pathname of the library into its soname. This can only be
> accomplished by modifying the appropriate .ml file within
> libstdc++/config (and also libg++/config, if you are building libg++),
> so that $(libdir)/ appears just before the library name in -soname or
> -h options.
>
>
> But I don't see any .ml files in these directories nor anything with
> the text "soname".  Does anyone have any idea how to do the above?
>
> Thanks,
> Noel
>
> On 10/31/05, Noel Yap <noel.yap@gmail.com> wrote:
> > First, some info:
> >
> > yapn:eng@yapn:~/proj/aoeu> g++ --verbose
> > Using built-in specs.
> > Target: i686-pc-linux-gnu
> > Configured with: ../gcc-4.0.2/configure
> > --prefix=/home/yapn/.mrm-vista/common/org/fsf/gcc/4.0.2
> > --exec-prefix=/home/yapn/.mrm-vista/kernel/processor/org/fsf/gcc/4.0.2
> > --enable-__cxa_atexit --enable-languages=c,c++,java
> > --enable-version-specific-runtime-libs
> > --with-gxx-include-dir=/home/yapn/.mrm-vista/common/org/fsf/gcc/4.0.2/include
> > Thread model: posix
> > gcc version 4.0.2
> >
> >
> > When I build an executable with this g++, it's not able to load in
> > libstdc++; there's no run path at all.  What do I need to do to get
> > g++ to create the correct run path automatically?  Or do I need to
> > specify explicitly the run path each time I use g++?
> >
> > Thanks,
> > Noel
> >
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
  2005-10-31 21:24 Noel Yap
@ 2005-11-01  1:30 ` Noel Yap
  2005-11-01  4:59   ` Noel Yap
  0 siblings, 1 reply; 5+ messages in thread
From: Noel Yap @ 2005-11-01  1:30 UTC (permalink / raw)
  To: gcc-help

OK, I read the FAQ and it says the following:

  Yet another option, that works on a few platforms, is to hard-code
the full pathname of the library into its soname. This can only be
accomplished by modifying the appropriate .ml file within
libstdc++/config (and also libg++/config, if you are building libg++),
so that $(libdir)/ appears just before the library name in -soname or
-h options.


But I don't see any .ml files in these directories nor anything with
the text "soname".  Does anyone have any idea how to do the above?

Thanks,
Noel

On 10/31/05, Noel Yap <noel.yap@gmail.com> wrote:
> First, some info:
>
> yapn:eng@yapn:~/proj/aoeu> g++ --verbose
> Using built-in specs.
> Target: i686-pc-linux-gnu
> Configured with: ../gcc-4.0.2/configure
> --prefix=/home/yapn/.mrm-vista/common/org/fsf/gcc/4.0.2
> --exec-prefix=/home/yapn/.mrm-vista/kernel/processor/org/fsf/gcc/4.0.2
> --enable-__cxa_atexit --enable-languages=c,c++,java
> --enable-version-specific-runtime-libs
> --with-gxx-include-dir=/home/yapn/.mrm-vista/common/org/fsf/gcc/4.0.2/include
> Thread model: posix
> gcc version 4.0.2
>
>
> When I build an executable with this g++, it's not able to load in
> libstdc++; there's no run path at all.  What do I need to do to get
> g++ to create the correct run path automatically?  Or do I need to
> specify explicitly the run path each time I use g++?
>
> Thanks,
> Noel
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
@ 2005-10-31 21:24 Noel Yap
  2005-11-01  1:30 ` Noel Yap
  0 siblings, 1 reply; 5+ messages in thread
From: Noel Yap @ 2005-10-31 21:24 UTC (permalink / raw)
  To: gcc-help

First, some info:

yapn:eng@yapn:~/proj/aoeu> g++ --verbose
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.2/configure
--prefix=/home/yapn/.mrm-vista/common/org/fsf/gcc/4.0.2
--exec-prefix=/home/yapn/.mrm-vista/kernel/processor/org/fsf/gcc/4.0.2
--enable-__cxa_atexit --enable-languages=c,c++,java
--enable-version-specific-runtime-libs
--with-gxx-include-dir=/home/yapn/.mrm-vista/common/org/fsf/gcc/4.0.2/include
Thread model: posix
gcc version 4.0.2


When I build an executable with this g++, it's not able to load in
libstdc++; there's no run path at all.  What do I need to do to get
g++ to create the correct run path automatically?  Or do I need to
specify explicitly the run path each time I use g++?

Thanks,
Noel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-12-06 15:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-06 15:01 error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory Rohit Arul Raj
2006-12-06 15:30 ` Ian Lance Taylor
  -- strict thread matches above, loose matches on Subject: below --
2005-10-31 21:24 Noel Yap
2005-11-01  1:30 ` Noel Yap
2005-11-01  4:59   ` Noel Yap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).