Skip to content
Advertisement

How to install the program depending on libstdc++ library

My program is written in C++, using GCC on Ubuntu 9.10 64 bit. If depends on /usr/lib64/libstdc++.so.6 which actually points to /usr/lib64/libstdc++.so.6.0.13. Now I copy this program to virgin Ubuntu 7.04 system and try to run it. It doesn’t run, as expected. Then I add to the program directory the following files:

  • libstdc++.so.6.0.13
  • libstdc++.so.6 (links to libstdc++.so.6.0.13)

Execute command:

LD_LIBRARY_PATH=. ./myprogram

Now everything is OK. The question: how can I write installation script for such program? myprogram file itself should be placed to /usr/local/bin. What can I do with dependencies? For example, on destination computer, /usr/lib64/libstdc++.so.6 link points to /usr/lib64/libstdc++.so.6.0.8. What can I do with this?

Note: the program is closed-source, I cannot provide source code and makefile.

Advertisement

Answer

If you’re working on Ubuntu, making a .deb (Debian Package) seems to way to go. Here is a link to get you started.

Your package will state it depends on some other packages (typically the packages that includes libstdc++.so.6.0.13 – i guess the package name is something like libstdc++) and dependencies will be installed when you install your own package using dpkg -i <yourpackage>.deb.

Afterwards, you’ll be able to uninstall it using dpkg -r <yourpackage>.

Anyway, never ship such standards files with your own archive. Dependencies exists for this exact purpose.

Hope it helps.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement