How to install the program depending on libstdc++ library


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.


Buffering of stream data

1:

PHP Segmentation fault when started from crond
If you're working on Ubuntu, making a .deb (Debian Package) seems to way to go. waiting for 2 different events in a single threadHere is a link to receive you started.. Low level Android Debugging Your package will state it depends on any another packages (typically the packages this includes libstdc++.so.6.0.13 - i guess the package name is any thing like libstdc++) and dependencies will be installed when you install your own package using dpkg -i <yourpackage>.deb.. Using Python to add/remove Ubuntu login script items Afterwards, you'll be able to uninstall it using dpkg -r <yourpackage>.. Microbenchmark showing process-switching faster than thread-switching; what's wrong? Anyway, never ship such standards files with your own archive. C++ build systems [closed]Dependencies exists for this exact purpose.. API to translate group name to group id (gid) Hope it helps..

2:

The real problem is this you try to install a binary this use newer versions os common libraries this the ones available on Ubuntu 9.10. The best option should be to make a specific tarreceive for the old Ubuntu 7.10 an compile it with the old libraries (that's a backport).. Then you should make two (or more) .deb packages, one for Ubuntu 9.10 and one for Ubuntu 7.10.. Ananother possibility is to continue doing what you are doing now : set LD_LIBRARY_PATH to point to the desired version of libstdc++ and another necessary libraries. You just set this environment variable in a launcher shell script. In you script you check if the new libraries are available or not and you set your LB_LIBRARY_PATH (say to /usr/local/lib/myprogram/) only if needed. But as others poster pointed out : that's a very bad practice. Anyway, never try to put these provided libraries at their standard place in Ubuntu 9.10, you would risk broking the tarreceive system and causing update problems for users or your program if these libraries are officially backported any day.. But if you choose to include your own set of system libraries there is still ananother way to go than the above one: just link these libraries statically. If a program is the only user of a library as it will probably be in the above scenario you'll lose all advantages of using a shared dynamic library, then why banother with using it at all ? And with stacically linked libraries you won't have to install them..


84 out of 100 based on 59 user ratings 694 reviews

*