由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - where is libstdc++
相关主题
C++5.0的初级问题how to transfer C program run under VC to Unix?
[转载] ask a question.need help about GDB
关于一个C++library的连接Does Linux support thread?
A problem[转载] ? on put/get file
please help, CGI..How to get the name of current executable in a library routine?
compiled on Solaris 9, run on Solaris 8?what's the difference between .a and .so,
how come this stupid question?[转载] Help, about clock().
Help: convert // to /* */ in C code?where to get latest version of vi for solaris?
相关话题的讨论汇总
话题: c++话题: libstd话题: path话题: usr话题: lib
进入Unix版参与讨论
1 (共1页)
n*****w
发帖数: 14
1
Any system admin here? I have this question related to c++ programming on
unix to ask for help.
While I can compile and run C programs with no problem, it's not the case
for C++. For example, after I edited a simple "Hello World" program
named "hello.cc" and compiled it using "g++ hello.cc", I got error
message executing the resulting "a.out", like this:
ld.so.1: a.out: fatal: libstdc++.so.2.10.0: open failed: No such file or
directory
It looks like libstdc++.so.2.10.0 is not available. I checke
x*****g
发帖数: 6
2
which unix you have ? solaris ? HP ? Digital Alpha ?
for solaris, you need to install the libgcc packages/
get them from
http://www.sunfreeware.com/programlistsparc8.html#libgcc

【在 n*****w 的大作中提到】
: Any system admin here? I have this question related to c++ programming on
: unix to ask for help.
: While I can compile and run C programs with no problem, it's not the case
: for C++. For example, after I edited a simple "Hello World" program
: named "hello.cc" and compiled it using "g++ hello.cc", I got error
: message executing the resulting "a.out", like this:
: ld.so.1: a.out: fatal: libstdc++.so.2.10.0: open failed: No such file or
: directory
: It looks like libstdc++.so.2.10.0 is not available. I checke

n*****w
发帖数: 14
3
solaris. But I can compile (gcc) and run c programs with no problem at all,
and I found libc.a and libc.so in /usr/lib/. Do u think it's missing c++
library? Is c++ library included in libgcc (as in your link)? Thanks.

【在 x*****g 的大作中提到】
: which unix you have ? solaris ? HP ? Digital Alpha ?
: for solaris, you need to install the libgcc packages/
: get them from
: http://www.sunfreeware.com/programlistsparc8.html#libgcc

n*****w
发帖数: 14
4
actually on another unix system, there is no libstdc++.* while it's
fine to run c++ program. Why?

【在 x*****g 的大作中提到】
: which unix you have ? solaris ? HP ? Digital Alpha ?
: for solaris, you need to install the libgcc packages/
: get them from
: http://www.sunfreeware.com/programlistsparc8.html#libgcc

o******d
发帖数: 1552
5
In Solaris, it is "libc.a" if it is static.

Any system admin here? I have this question related to c++ programming on
unix to ask for help.
While I can compile and run C programs with no problem, it's not the case
for C++. For example, after I edited a simple "Hello World" program
named "hello.cc" and compiled it using "g++ hello.cc", I got error
message executing the resulting "a.out", like this:
ld.so.1: a.out: fatal: libstdc++.so.2.10.0: open failed: No such file or
directory
It looks like l

【在 n*****w 的大作中提到】
: Any system admin here? I have this question related to c++ programming on
: unix to ask for help.
: While I can compile and run C programs with no problem, it's not the case
: for C++. For example, after I edited a simple "Hello World" program
: named "hello.cc" and compiled it using "g++ hello.cc", I got error
: message executing the resulting "a.out", like this:
: ld.so.1: a.out: fatal: libstdc++.so.2.10.0: open failed: No such file or
: directory
: It looks like libstdc++.so.2.10.0 is not available. I checke

c*****t
发帖数: 1879
6
There are several places to check...
If the administrator built the gcc/g++ by himself, he can put libstdc++.a
in just about any place since the path info is given at the compile time.
Usually, what you need to do is to search
/usr/lib/
/usr/local
/usr/local/lib
and look for directories w/ gcc/g++ prefixes. Some times, checking the
location of g++/gcc (since they can be a soft link indicate where the
stuff is). On solaris, also check /opt.
Also, do the man page on g++ a

【在 n*****w 的大作中提到】
: Any system admin here? I have this question related to c++ programming on
: unix to ask for help.
: While I can compile and run C programs with no problem, it's not the case
: for C++. For example, after I edited a simple "Hello World" program
: named "hello.cc" and compiled it using "g++ hello.cc", I got error
: message executing the resulting "a.out", like this:
: ld.so.1: a.out: fatal: libstdc++.so.2.10.0: open failed: No such file or
: directory
: It looks like libstdc++.so.2.10.0 is not available. I checke

w**n
发帖数: 88
7
Probably that is the case: Gnu complier does not come with solaris, the
lib location is totaly decided by the admin who installed it.by default,
it should be in /usr/local/lib.
So, find out the file, add the cresponding path to your LD_LIBRARY_PATH
varible.

【在 n*****w 的大作中提到】
: Any system admin here? I have this question related to c++ programming on
: unix to ask for help.
: While I can compile and run C programs with no problem, it's not the case
: for C++. For example, after I edited a simple "Hello World" program
: named "hello.cc" and compiled it using "g++ hello.cc", I got error
: message executing the resulting "a.out", like this:
: ld.so.1: a.out: fatal: libstdc++.so.2.10.0: open failed: No such file or
: directory
: It looks like libstdc++.so.2.10.0 is not available. I checke

n*****w
发帖数: 14
8
u r right. I found libstdc++.a.2.10.0 and libstdc++.so.2.10.0 at
/usr/local/lib/ (but libc.a is at /usr/lib/). Now I wonder how to add
to LD_LIBRARY_PATH. I don't have such an environmental variable.
I've tried the following, but all compiled fine and got error when executing:
1. g++ hello.cc (ok, => a.out)
a.out (error, as in original post)
2. g++ -c hello.cc
g++ -o hello -lg++ hello.o (error, no library g++ found)
3. g++ -c hello.cc
g++ -o hello -L/usr/local/lib/ hello.o
a.out (same error as i

【在 w**n 的大作中提到】
: Probably that is the case: Gnu complier does not come with solaris, the
: lib location is totaly decided by the admin who installed it.by default,
: it should be in /usr/local/lib.
: So, find out the file, add the cresponding path to your LD_LIBRARY_PATH
: varible.

m*****e
发帖数: 4193
9

Do you know what you are doing? Hint: -o hello

【在 n*****w 的大作中提到】
: u r right. I found libstdc++.a.2.10.0 and libstdc++.so.2.10.0 at
: /usr/local/lib/ (but libc.a is at /usr/lib/). Now I wonder how to add
: to LD_LIBRARY_PATH. I don't have such an environmental variable.
: I've tried the following, but all compiled fine and got error when executing:
: 1. g++ hello.cc (ok, => a.out)
: a.out (error, as in original post)
: 2. g++ -c hello.cc
: g++ -o hello -lg++ hello.o (error, no library g++ found)
: 3. g++ -c hello.cc
: g++ -o hello -L/usr/local/lib/ hello.o

w**n
发帖数: 88
10
csh/tcsh: setenv LD_LIBARY_PATH $LD_LIBARY_PATH:/usr/local/lib
bourn:
LD_LIBARY_PATH=$LD_LIBARY_PATH:/usr/local/lib
export LD_LIBARY_PATH
在 netview (Net Viewer) 的大作中提到: 】
n*****w
发帖数: 14
11

what's wrong here? linking ah. If u mean i should link with another object
or library, that's what i tried in #4.

【在 m*****e 的大作中提到】
:
: Do you know what you are doing? Hint: -o hello

n*****w
发帖数: 14
12
Thanks. What about bash? Currently $LD_LIBRARY_PATH is not set.

【在 w**n 的大作中提到】
: csh/tcsh: setenv LD_LIBARY_PATH $LD_LIBARY_PATH:/usr/local/lib
: bourn:
: LD_LIBARY_PATH=$LD_LIBARY_PATH:/usr/local/lib
: export LD_LIBARY_PATH
: 在 netview (Net Viewer) 的大作中提到: 】

m*****e
发帖数: 4193
13

You output hello, while you run a.out

【在 n*****w 的大作中提到】
: Thanks. What about bash? Currently $LD_LIBRARY_PATH is not set.
n*****w
发帖数: 14
14
oh, of course i changed the name of the executable.

【在 m*****e 的大作中提到】
:
: You output hello, while you run a.out

1 (共1页)
进入Unix版参与讨论
相关主题
where to get latest version of vi for solaris?please help, CGI..
Question about DDD Debuggercompiled on Solaris 9, run on Solaris 8?
有人熟悉solaris 10的?how come this stupid question?
Is there a decent debugger for gcc?Help: convert // to /* */ in C code?
C++5.0的初级问题how to transfer C program run under VC to Unix?
[转载] ask a question.need help about GDB
关于一个C++library的连接Does Linux support thread?
A problem[转载] ? on put/get file
相关话题的讨论汇总
话题: c++话题: libstd话题: path话题: usr话题: lib