4


In Linux(Ubuntu) I am trying to run a tool and it is showing error "library missing". I don't have permission to install anything in the system (or simply sudo is not possible from my user account).
Is it possible to install missing library (libstdc++.so.6 in my case) in my home directory (without sudo) and change the environment-variables etc. so that all other tools/programs can find it?

d.putto
  • 7,185
  • 11
  • 39
  • 45

1 Answers1

4

Yes, assuming the library is in /home/user/lib. You can set use the LD_LIBRARY_PATH environment variable to find the lib. LD_LIBRARY_PATH=/home/user/lib, which will find the library. If you have to compile it yourself you will want to use configure --prefix=/home/user.

I'm surprised that libstdc++.so.6 isn't available on the system already. Take a look in /usr/lib/x86_64-linux-gnu. If could just be your program isn't multiarch aware.

Daniel Böhmer
  • 14,463
  • 5
  • 36
  • 46
Marc
  • 2,886
  • 1
  • 15
  • 12
  • I added export LD_LIBRARY_PATH="/usr/lib" in my .bashrc (because locate libstdc++.so shows /usr/lib/libstdc++.so.6 ) but now I am getting error 'wrong ELF class: ELFCLASS64' :( – d.putto Jan 20 '12 at 16:31
  • Sounds like you have 32bit vs 64bit issues. To discover the types of everything do "file libstdc++.so.6" and "file youprogram". Also "uname -a". That should show you what your system is and what the program is. I'm guessing your program is a 32bit pre-compiled binary from somewhere. It will probably be easiest to recompile it from source on the target machine. – Marc Jan 20 '12 at 19:34