From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Topham To: help-gcc@gnu.org Subject: libstdc++.so Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: <3852B5FF.97D8B4DC@csuhayward.edu> References: <3850F092.3F08B0EF@icn.siemens.de> X-SW-Source: 1999-12n/msg00173.html Message-ID: <19991231222400.MqjAJaAxV3NE7m5ZXX0eUi1IQb3CEJooFBYWqAiBM44@z> 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