public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: help :: cant run due to libstdc++
@ 2001-03-01  7:36 David Korn
  2001-03-01 20:39 ` Umapathy S
  0 siblings, 1 reply; 9+ messages in thread
From: David Korn @ 2001-03-01  7:36 UTC (permalink / raw)
  To: 'Umapathy S', Anthony Lee; +Cc: gcc-help

>-----Original Message-----
>From: Umapathy S [ mailto:nsupathy@myrealbox.com ]
>Sent: 01 March 2001 17:13

>I tried to link forcibly as
>    /usr/local/bin/g++ -ohello hello.o 
>-l/usr/local/lib/libstdc++.a.2.10.0
>
>I got the list of errors as follows
>    ld: fatal: library -l/usr/local/lib/libstdc++.a.2.10.0: not found
>(!!!!but it is there and not corrupted)
>    ld: fatal: File processing errors. No output written to hello
>    collect2: ld returned 1 exit status

  Check the file permissions for it: is it not readable by you perhaps?

>>     ld.so.1:hello: fatal: libstdc++.so.2.10.0: open failed: No such
>> file or directory

  This is an error message from the dynamic linker.  Your copy of gcc has
a dynamic link library for libstdc++, and it is not the 'ld' linker that
is failing and complaining, but the 'ld.so' dynamic (run-time) linker.
Note that libstdc++.so.2.10.0 is not the same as libstdc++.a.2.10.0

  Try using

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib

to add /usr/local/lib to the places searched by the dynamic linker.

  These are just suggestions: let us know if they work or not.

       DaveK
-- 
 All your base are belong to us!


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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

* Re: help :: cant run due to libstdc++
  2001-03-01  7:36 help :: cant run due to libstdc++ David Korn
@ 2001-03-01 20:39 ` Umapathy S
  2001-03-01 20:46   ` Alexandre Oliva
  0 siblings, 1 reply; 9+ messages in thread
From: Umapathy S @ 2001-03-01 20:39 UTC (permalink / raw)
  To: David Korn; +Cc: gcc-help

Thanks David, it works
I followed both of your suggestions to make it work

Previously, I didnt care about the permissions for libstdc++.so.2.10.0,
because I installed the package as root (super user, I suspect I cant
install, if I am not a root).  The permissions for that file are -r-xr-xr-x.
So I should be able to execute "hello" in my own login, but I cant.  During
run time, when I am invoking "hello" it says "open failed: No such file or
directory".  For inadequate permissions it should have said "Permission
denied". It is not identifying the directory.

I logined as root and try executing the same file, it executed.

I already set the Library path for the linker, so that was not a  problem

May be I am missing something important

cheers
Umapathy S


----- Original Message -----
From: "David Korn" <dkorn@pixelpower.com>
To: "'Umapathy S'" <nsupathy@myrealbox.com>; "Anthony Lee"
<al012@energex.com.au>
Cc: <gcc-help@gcc.gnu.org>
Sent: Thursday, March 01, 2001 3:42 PM
Subject: RE: help :: cant run due to libstdc++


>
> >-----Original Message-----
> >From: Umapathy S [ mailto:nsupathy@myrealbox.com ]
> >Sent: 01 March 2001 17:13
>
> >I tried to link forcibly as
> >    /usr/local/bin/g++ -ohello hello.o
> >-l/usr/local/lib/libstdc++.a.2.10.0
> >
> >I got the list of errors as follows
> >    ld: fatal: library -l/usr/local/lib/libstdc++.a.2.10.0: not found
> >(!!!!but it is there and not corrupted)
> >    ld: fatal: File processing errors. No output written to hello
> >    collect2: ld returned 1 exit status
>
>   Check the file permissions for it: is it not readable by you perhaps?
>
> >>     ld.so.1:hello: fatal: libstdc++.so.2.10.0: open failed: No such
> >> file or directory
>
>   This is an error message from the dynamic linker.  Your copy of gcc has
> a dynamic link library for libstdc++, and it is not the 'ld' linker that
> is failing and complaining, but the 'ld.so' dynamic (run-time) linker.
> Note that libstdc++.so.2.10.0 is not the same as libstdc++.a.2.10.0
>
>   Try using
>
> export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
>
> to add /usr/local/lib to the places searched by the dynamic linker.
>
>   These are just suggestions: let us know if they work or not.
>
>        DaveK
> --
>  All your base are belong to us!
>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
> www.mimesweeper.com
> **********************************************************************
>

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

* Re: help :: cant run due to libstdc++
  2001-03-01 20:39 ` Umapathy S
@ 2001-03-01 20:46   ` Alexandre Oliva
  2001-03-01 21:00     ` Umapathy S
  0 siblings, 1 reply; 9+ messages in thread
From: Alexandre Oliva @ 2001-03-01 20:46 UTC (permalink / raw)
  To: Umapathy S; +Cc: David Korn, gcc-help

On Mar  2, 2001, "Umapathy S" <nsupathy@myrealbox.com> wrote:

> I logined as root and try executing the same file, it executed.

See whether root has LD_LIBRARY_PATH set or something like that.  I'm
pretty sure this is not a permission problem.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* Re: help :: cant run due to libstdc++
  2001-03-01 20:46   ` Alexandre Oliva
@ 2001-03-01 21:00     ` Umapathy S
  2001-03-01 21:54       ` Alexandre Oliva
  2001-03-01 21:59       ` Umapathy S
  0 siblings, 2 replies; 9+ messages in thread
From: Umapathy S @ 2001-03-01 21:00 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: David Korn, gcc-help

I checked that out.
LD_LIBRARY_PATH of root was not set to /usr/local/lib. If I execute now, the
same open failed erorr occurs.  Then, I set it to /usr/local/lib, it
executes fine.

But in my login  LD_LIBRARY_PATH  is set to /usr/local/lib already. If I
execute my "hello" program it says open failed error.

Still cant trace out.

----- Original Message -----
From: "Alexandre Oliva" <aoliva@redhat.com>
To: "Umapathy S" <nsupathy@myrealbox.com>
Cc: "David Korn" <dkorn@pixelpower.com>; <gcc-help@gcc.gnu.org>
Sent: Friday, March 02, 2001 4:46 AM
Subject: Re: help :: cant run due to libstdc++


> On Mar  2, 2001, "Umapathy S" <nsupathy@myrealbox.com> wrote:
>
> > I logined as root and try executing the same file, it executed.
>
> See whether root has LD_LIBRARY_PATH set or something like that.  I'm
> pretty sure this is not a permission problem.
>
> --
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist    *Please* write to mailing lists, not to me
>

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

* Re: help :: cant run due to libstdc++
  2001-03-01 21:00     ` Umapathy S
@ 2001-03-01 21:54       ` Alexandre Oliva
  2001-03-01 21:59       ` Umapathy S
  1 sibling, 0 replies; 9+ messages in thread
From: Alexandre Oliva @ 2001-03-01 21:54 UTC (permalink / raw)
  To: Umapathy S; +Cc: David Korn, gcc-help

On Mar  2, 2001, "Umapathy S" <nsupathy@myrealbox.com> wrote:

> But in my login  LD_LIBRARY_PATH  is set to /usr/local/lib already.

Is it exported?  (or setenved, depending on the shell you use)

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* Re: help :: cant run due to libstdc++
  2001-03-01 21:00     ` Umapathy S
  2001-03-01 21:54       ` Alexandre Oliva
@ 2001-03-01 21:59       ` Umapathy S
  1 sibling, 0 replies; 9+ messages in thread
From: Umapathy S @ 2001-03-01 21:59 UTC (permalink / raw)
  To: gcc-help; +Cc: David Korn, Anthony Lee

I sorted it out.
I made the changes in my .profile LD_LIBRARY_PATH
Then I logged out and logged in.
It worked fine.
Thanks for all ur help
cheers
Umapathy S

----- Original Message -----
From: "Umapathy S" <nsupathy@myrealbox.com>
To: "Alexandre Oliva" <aoliva@redhat.com>
Cc: "David Korn" <dkorn@pixelpower.com>; <gcc-help@gcc.gnu.org>
Sent: Friday, March 02, 2001 11:35 AM
Subject: Re: help :: cant run due to libstdc++


> I checked that out.
> LD_LIBRARY_PATH of root was not set to /usr/local/lib. If I execute now,
the
> same open failed erorr occurs.  Then, I set it to /usr/local/lib, it
> executes fine.
>
> But in my login  LD_LIBRARY_PATH  is set to /usr/local/lib already. If I
> execute my "hello" program it says open failed error.
>
> Still cant trace out.
>
> ----- Original Message -----
> From: "Alexandre Oliva" <aoliva@redhat.com>
> To: "Umapathy S" <nsupathy@myrealbox.com>
> Cc: "David Korn" <dkorn@pixelpower.com>; <gcc-help@gcc.gnu.org>
> Sent: Friday, March 02, 2001 4:46 AM
> Subject: Re: help :: cant run due to libstdc++
>
>
> > On Mar  2, 2001, "Umapathy S" <nsupathy@myrealbox.com> wrote:
> >
> > > I logined as root and try executing the same file, it executed.
> >
> > See whether root has LD_LIBRARY_PATH set or something like that.  I'm
> > pretty sure this is not a permission problem.
> >
> > --
> > Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> > Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
> > CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> > Free Software Evangelist    *Please* write to mailing lists, not to me
> >
>
>

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

* Re: help :: cant run due to libstdc++
  2001-02-28 23:32 ` Anthony Lee
@ 2001-03-01  2:38   ` Umapathy S
  0 siblings, 0 replies; 9+ messages in thread
From: Umapathy S @ 2001-03-01  2:38 UTC (permalink / raw)
  To: Anthony Lee; +Cc: gcc-help

thanks for the info Lee
But I thought that g++ will take care of C++ library linker options
I tried to link forcibly as
    /usr/local/bin/g++ -ohello hello.o -l/usr/local/lib/libstdc++.a.2.10.0

I got the list of errors as follows
    ld: fatal: library -l/usr/local/lib/libstdc++.a.2.10.0: not found
(!!!!but it is there and not corrupted)
    ld: fatal: File processing errors. No output written to hello
    collect2: ld returned 1 exit status

thanks for any ideas
cheers
Umapathy S


----- Original Message -----
From: "Anthony Lee" <al012@energex.com.au>
To: "Umapathy S" <nsupathy@myrealbox.com>
Cc: <gcc-help@gcc.gnu.org>
Sent: Thursday, March 01, 2001 7:28 AM
Subject: Re: help :: cant run due to libstdc++


> I am not sure about Solaris but I would have thought there must be
> some environment variable pointing to where your lib is.
> You could try
>
> env | more
>
> to see if anything looks like what you are looking for and see
> if it is set correctly.
>
> Umapathy S wrote:
> >
> > hi all
> >     A trivial error but dont know how to solve it
> >     I am trying to use gcc/g++ to compile a helloworld C++ program
> >     Here is the program
> >
> >     Problem :
> >
> >     //hello.C prints "hello, world" to stdout
> >     #include <iostream>
> >
> >     using namespace std;
> >
> >     int main(int argc, char *argv[])    {
> >
> >         char str[]="hello, world";
> >         cout << str << endl;
> >         return 0;
> >     } //end of main
> >
> >     The make file for the program is as follows
> >     #makefile to compile hello.C program
> >     CC=/usr/local/bin/g++
> >
> >     all:hello.o
> >         ${CC} -ohello hello.o
> >
> >     hello.o:hello.C
> >         ${CC} -c hello.C
> >
> >     clean:
> >         rm -f hello.o hello
> >
> >     The compilation part is done well, but when I try to execute hello
the
> > following error occurs
> >
> >     ld.so.1:hello: fatal: libstdc++.so.2.10.0: open failed: No such file
or
> > directory
> >     Killed
> >
> >     Platform :
> >         using gnu gcc  2.95.2 19991024 (release) on Solaris  2.6
> >
> >     Reasons :
> >         I checked out libstdc++.so.2.10.0, it is in
> > /usr/local/lib/libstdc++.so.2.10.0
> >         I am not using linking options like -nodefaultlibs and -nostdlib
> >
> >     Thanks in advance for any help
> >
> > cheers
> > Umapathy S
>
> --
> Anthony Lee
> Energex
> 150 Charlotte Street                 ..--  __o
> Brisbane                        ....--   _ \<,_
> Qld 4000                       ____     (_)/ (_)
> Australia
> voice:+61 7 3407 4541
> fax:  +61 7 3407 4607
> email: AL012@energex.com.au
>
>
> --------------------------------------------------------------------------
---------------------------------------------------------------------------
> This email message (and any accompanying file attachments) may contain
confidential or
> privileged information and is intended for the sole use of the addressee
named above. If you
> are not the intended recipient, or the person responsible for delivering
this message to the
> intended recipient, please notify ENERGEX immediately and destroy any
copies of the original
> message.
>
> Any unauthorised review, use, alteration, disclosure or distribution of
this email (including any
> attachments) by an unintended recipient is prohibited.
>
> ENERGEX accepts no responsibility for the content of any email which is
sent by an employee
> which is of a personal nature.
>

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

* Re: help :: cant run due to libstdc++
  2001-02-28 23:25 Umapathy S
@ 2001-02-28 23:32 ` Anthony Lee
  2001-03-01  2:38   ` Umapathy S
  0 siblings, 1 reply; 9+ messages in thread
From: Anthony Lee @ 2001-02-28 23:32 UTC (permalink / raw)
  To: Umapathy S; +Cc: gcc-help

I am not sure about Solaris but I would have thought there must be
some environment variable pointing to where your lib is. 
You could try 

env | more

to see if anything looks like what you are looking for and see
if it is set correctly.

Umapathy S wrote:
> 
> hi all
>     A trivial error but dont know how to solve it
>     I am trying to use gcc/g++ to compile a helloworld C++ program
>     Here is the program
> 
>     Problem :
> 
>     //hello.C prints "hello, world" to stdout
>     #include <iostream>
> 
>     using namespace std;
> 
>     int main(int argc, char *argv[])    {
> 
>         char str[]="hello, world";
>         cout << str << endl;
>         return 0;
>     } //end of main
> 
>     The make file for the program is as follows
>     #makefile to compile hello.C program
>     CC=/usr/local/bin/g++
> 
>     all:hello.o
>         ${CC} -ohello hello.o
> 
>     hello.o:hello.C
>         ${CC} -c hello.C
> 
>     clean:
>         rm -f hello.o hello
> 
>     The compilation part is done well, but when I try to execute hello the
> following error occurs
> 
>     ld.so.1:hello: fatal: libstdc++.so.2.10.0: open failed: No such file or
> directory
>     Killed
> 
>     Platform :
>         using gnu gcc  2.95.2 19991024 (release) on Solaris  2.6
> 
>     Reasons :
>         I checked out libstdc++.so.2.10.0, it is in
> /usr/local/lib/libstdc++.so.2.10.0
>         I am not using linking options like -nodefaultlibs and -nostdlib
> 
>     Thanks in advance for any help
> 
> cheers
> Umapathy S

-- 
Anthony Lee	
Energex                                            
150 Charlotte Street                 ..--  __o 
Brisbane                        ....--   _ \<,_               
Qld 4000                       ____     (_)/ (_)                         
Australia
voice:+61 7 3407 4541
fax:  +61 7 3407 4607
email: AL012@energex.com.au


-----------------------------------------------------------------------------------------------------------------------------------------------------
This email message (and any accompanying file attachments) may contain confidential or 
privileged information and is intended for the sole use of the addressee named above. If you 
are not the intended recipient, or the person responsible for delivering this message to the 
intended recipient, please notify ENERGEX immediately and destroy any copies of the original 
message.

Any unauthorised review, use, alteration, disclosure or distribution of this email (including any 
attachments) by an unintended recipient is prohibited.

ENERGEX accepts no responsibility for the content of any email which is sent by an employee 
which is of a personal nature.

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

* help :: cant run due to libstdc++
@ 2001-02-28 23:25 Umapathy S
  2001-02-28 23:32 ` Anthony Lee
  0 siblings, 1 reply; 9+ messages in thread
From: Umapathy S @ 2001-02-28 23:25 UTC (permalink / raw)
  To: gcc-help

hi all
    A trivial error but dont know how to solve it
    I am trying to use gcc/g++ to compile a helloworld C++ program
    Here is the program

    Problem :

    //hello.C prints "hello, world" to stdout
    #include <iostream>

    using namespace std;

    int main(int argc, char *argv[])    {

        char str[]="hello, world";
        cout << str << endl;
        return 0;
    } //end of main

    The make file for the program is as follows
    #makefile to compile hello.C program
    CC=/usr/local/bin/g++

    all:hello.o
        ${CC} -ohello hello.o

    hello.o:hello.C
        ${CC} -c hello.C

    clean:
        rm -f hello.o hello

    The compilation part is done well, but when I try to execute hello the
following error occurs

    ld.so.1:hello: fatal: libstdc++.so.2.10.0: open failed: No such file or
directory
    Killed

    Platform :
        using gnu gcc  2.95.2 19991024 (release) on Solaris  2.6

    Reasons :
        I checked out libstdc++.so.2.10.0, it is in
/usr/local/lib/libstdc++.so.2.10.0
        I am not using linking options like -nodefaultlibs and -nostdlib

    Thanks in advance for any help

cheers
Umapathy S



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

end of thread, other threads:[~2001-03-01 21:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-01  7:36 help :: cant run due to libstdc++ David Korn
2001-03-01 20:39 ` Umapathy S
2001-03-01 20:46   ` Alexandre Oliva
2001-03-01 21:00     ` Umapathy S
2001-03-01 21:54       ` Alexandre Oliva
2001-03-01 21:59       ` Umapathy S
  -- strict thread matches above, loose matches on Subject: below --
2001-02-28 23:25 Umapathy S
2001-02-28 23:32 ` Anthony Lee
2001-03-01  2:38   ` Umapathy S

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).