How to link to some lib in runtime as a nonsuper user?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to link to some lib in runtime as a nonsuper user?
# 1  
Old 03-11-2006
Error How to link to some lib in runtime as a nonsuper user?

My program is written in cpp and it uses a non standard library. I have compiled successfully by linking it to the library. But when i try to run the program. it give a error message like:
"error while loading shared libraries: ***.so: cannot open shared object file: No such file or directory"
and when i use ldd command, it shows cannot find the ***.so.

I guess i need to add the library directory to the runtime search path. But i do not have enough privillage to add the path to $LD_LIBRARY_PATH in the system. So any suggestion to deal with this problem?? Smilie Smilie

Thank you very much for kind enlightment!!!!

Btw, I am using g++ 3.4.4 (Seems i can use -R/...../lib to set the path during compile/linking time in some old versions.) But new one cannot recognize it Smilie Smilie
# 2  
Old 03-11-2006
Add a directory to your LD_LIBRARY_PATH. You don't need to affect my LD_LIBRARY_PATH to run your program. The syntax depends on your shell. With ksh or bash:

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/some/other/directory
export LD_LIBRARY_PATH

And you can put that in your .profile file so it happens whenever you logon.
# 3  
Old 03-12-2006
Thank you very much. It worksSmilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Runtime Error Enable user directory apache

Hi I am exactly according to this link CentOS 6 - Apache httpd - Enable Userdir : Server World I Enabled userDirectory Server version: Apache/2.2.15 CentOS release 6.8 (Final) But Iget this Error Forbidden You don't have permission to access /~mn/index.html on this server Goal... (2 Replies)
Discussion started by: mnnn
2 Replies

2. Shell Programming and Scripting

Passwordless sftp using a different user than the runtime user

I am running a shell script as user A. In that script I need to execute a sftp that would transfer the file using another user B. I am using the below command: sftp -oPort22 B@remote server However, I am getting password prompts each time. I have done the following: Added the public... (4 Replies)
Discussion started by: mady135
4 Replies

3. Red Hat

link /lib /lib64

i have redhat 5 and i need to link /lib and /lib64 from workstation 1 to workstation 2 i need the same /lib /lib64 in two workstation how can i make that ???????? (4 Replies)
Discussion started by: ayman
4 Replies

4. Programming

g++ fails to link to static library when compilation and link in single command

Hello All, I've encountered a strange behaviour from g++ that doesn't make sense to me. Maybe you can shed some light on it: I have a bunch of source files and want to compile them and link them with a static library liba.a located in /usr/local/lib64 into an executable Approach 1 works... (0 Replies)
Discussion started by: magelord
0 Replies

5. Red Hat

ls: /lib/libattr.so.1: no version information available (required by /lib/libacl.so.1)

Hello, I'm experimenting a problem on my rh server. Red Hat Enterprise Linux AS release 3 (Taroon Update 8) 2.4.21-47.ELsmp #1 SMP i686 i686 i386 GNU/Linux It started with a segmentation fault on #id root To resolve it, I've installed coreutils-4.5.3-28.4.i386.rpm But, I... (6 Replies)
Discussion started by: gogol_bordello
6 Replies

6. Solaris

Accidentally deleted s. link /usr/lib/secure/s8_preload.so.1

I have accidentally deleted the sim link: /usr/lib/secure/s8_preload.so.1 -> /.SUNWnative/usr/lib/brand/solaris8/s8_preload.so.1 and now I can't do almost anything in my Solaris 8 container. I still have an open session to the machine. I can not create the link again because trying to run:... (1 Reply)
Discussion started by: qwertysas
1 Replies

7. AIX

Multi Link Interface Runtime - where to download ?

Hello, I need "devices.common.IBM.ml 1.4.0.0 C F Multi Link Interface Runtime" to be installed on my machine. I need it for two SAN cards to work correctly. Where do I get it ? thanks Vilius (1 Reply)
Discussion started by: vilius
1 Replies

8. Shell Programming and Scripting

To Change the user during runtime

Hi, I have a requirement to change the user during runtime within a shell script. Is their any way via which I can change the user by prefeeding the password? Please reply. Thanks. (4 Replies)
Discussion started by: sam_roy
4 Replies

9. Programming

How to link lib or Dll using gcc

I had this lib which I don't have access to the source code and is created by micosoft Visual C++ compiler ...... Right now I want to reuse this lib as part of my new project which only has gcc as the only compiler... I had the problem that the lib won't link to my other c code... my... (2 Replies)
Discussion started by: yuwang
2 Replies
Login or Register to Ask a Question