This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++.so


I am trying to compile and link my c++ program using g++ (gcc) on one unix
machine (SunOS) then ftp the executable to another unix machine (also
SunOS). When I do that I get this error msg:
ld .so.1 : pgmname : fatal libstdc++.so.2.8.1 "can't open file error-2"

With the help of my sysadmin I figured out that there is a run-time lib
needed to run c++ programs on unix!
(Got to learn sometime)
Anyway, I can set LD_LIBRARY_PATH to the directory where libstdc++.so.2.8.1
resides and then it's OK.

What I want to do instead is to link with the lib path included in the
program itself. I found some info
that seemed to indicate that I can compile/link with options such as -R  or
-rpath  or to set the environment
variable LD_RUN_PATH to force that to be used as run-time lib path, but
none of these option seem to work for me yet.
Has anyone tried to do this using GNU c++ compiler/linker?

I think if I can do this, then when I move my program to the new machine
(which does not have the stdlibc++.so in the same path as it is on the
linking machine),
I can get it to run OK without setting LD_LIBRARY_PATH.

I have tried several attempts:
1) env LD_RUN_PATH=   (the path on the target machine where libstdc++.so
resides)
   then compiling with no options    (seemed to have no effect)
2) using -R option
3) using -rpath option
   (these don't seem to be supported under GNU c++?)

The reason for not wanting to set LD_LIBRARY_PATH is because that can only
be done per user, but I want to invoke my program remotely from a cgi bin
via the web server -- and it doesn't have the path to the lib

Thanks for any suggestions, I appreciate it very much, -Dave




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]