public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* a problem about "g++"
@ 2000-03-13 15:02 Bo Xu
  2000-03-13 15:57 ` Mo McKinlay
  0 siblings, 1 reply; 4+ messages in thread
From: Bo Xu @ 2000-03-13 15:02 UTC (permalink / raw)
  To: gcc

Hi,

1. I download gcc-2.95.2 from http://sunfreeware.com , and install it.
when I use "gcc" to compile a C file, it works well.


2. but when I use "g++  hello.cc -o hello" , "hello" file has been made.
but when I "excute it", I see the following:

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

3. I find that the file "libstdc++.so.2.10.0" is in /usr/local/lib


4. the file "hello.cc" is:

#include <iostream.h>
int main(){
cout << "hello!\n";
return 0;
}


So could anybody tell me how I can set my "enviroment"  to run "hello"
?  I guess it is a simple question, but because this is the first time I
use "g++", so I don't know  :-).



Bo
Ottawa
Mar.13,2000


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

* Re: a problem about "g++"
  2000-03-13 15:02 a problem about "g++" Bo Xu
@ 2000-03-13 15:57 ` Mo McKinlay
  2000-03-13 16:44   ` Martin v. Loewis
  0 siblings, 1 reply; 4+ messages in thread
From: Mo McKinlay @ 2000-03-13 15:57 UTC (permalink / raw)
  To: Bo Xu; +Cc: gcc

# So could anybody tell me how I can set my "enviroment"  to run "hello"
# ?  I guess it is a simple question, but because this is the first time I
# use "g++", so I don't know  :-).

[I'm assuming you're running Linux here - if you're not, my advice may be
useless - Sorry :)]

Usually the best way, if it's your own system, is to add /usr/local/lib to
the end of /etc/ld.so.conf, then run 'ldconfig -v' (you'll need to be
'root' to do both of these, normally). 

The other way is to add something like this (if you're using a sh-based
shell) to your profile:

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

I think all that was correct - I apologize (and hope someone sets me
straight!) if it wasn't. 

Hope this helps.

-- 
Mo McKinlay                                T: +44 (0) 709 22 55 05  x1
Chief Software Architect                   F: +44 (0) 709 22 55 05  x3
inter/open                                 E: mmckinlay@labs.interopen.org
A division of Bekon Marketing Limited      W: http://www.interopen.org

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

* Re: a problem about "g++"
  2000-03-13 15:57 ` Mo McKinlay
@ 2000-03-13 16:44   ` Martin v. Loewis
  2000-03-13 17:34     ` Mo McKinlay
  0 siblings, 1 reply; 4+ messages in thread
From: Martin v. Loewis @ 2000-03-13 16:44 UTC (permalink / raw)
  To: mmckinlay; +Cc: bo, gcc

> [I'm assuming you're running Linux here - if you're not, my advice may be
> useless - Sorry :)]
[...]
> I think all that was correct - I apologize (and hope someone sets me
> straight!) if it wasn't. 

Your comment on LD_LIBRARY_PATH was correct; your assumption that it
is a Linux system was probably not - he said that he got the binary
from sunfreeware.com :-)

Martin

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

* Re: a problem about "g++"
  2000-03-13 16:44   ` Martin v. Loewis
@ 2000-03-13 17:34     ` Mo McKinlay
  0 siblings, 0 replies; 4+ messages in thread
From: Mo McKinlay @ 2000-03-13 17:34 UTC (permalink / raw)
  To: bo; +Cc: gcc

# Your comment on LD_LIBRARY_PATH was correct; your assumption that it
# is a Linux system was probably not - he said that he got the binary
# from sunfreeware.com :-)

I apologise - I should've spotted that, and the obvious reference to
"ld.so.1" (considering I was hacking around attempting to find a way of
executing Solaris x86 ELF binaries under Linux just this weekend, this is
something I should've noticed!)

If my memory serves me, however, the Solaris and Linux architectures in
this respect are pretty similar. I'm pretty sure /etc/ld.so.conf and
ldconfig -v do the same thing on both platforms. Unfortunately, I don't
have a Solaris machine to play with at the moment, so I can't confirm
this. 

Incidentally, does anybody know a way to execute Solaris x86 binaries
under Linux? I know the reverse is possible (i.e., executing Linux
binaries under Solaris). If anybody has any ideas on how to do this (short
of dual booting!), let me know in a private e-mail. Perhaps the GNU
Universal Emulation System needs to be created? :-)

-- 
Mo McKinlay                                T: +44 (0) 709 22 55 05  x1
Chief Software Architect                   F: +44 (0) 709 22 55 05  x3
inter/open                                 E: mmckinlay@labs.interopen.org
A division of Bekon Marketing Limited      W: http://www.interopen.org

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

end of thread, other threads:[~2000-03-13 17:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-13 15:02 a problem about "g++" Bo Xu
2000-03-13 15:57 ` Mo McKinlay
2000-03-13 16:44   ` Martin v. Loewis
2000-03-13 17:34     ` Mo McKinlay

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