Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am compiling a program on my linux system that I want to run on another linux system. When I run the program on the other system, it says it can't find the shared library libstdc++.so.5. That sounds like some basic stuff to me, but it ain't there.
Is there anyway to make g++ build a standalone execuatable that won't require shared libraries? Or some other way to make it work on another linux system?
BTW, I do not have root access to the other system.
Thanks-
Erik
Last edited by ErikJohnson; 03-30-2004 at 10:47 PM.
I notice when using the -static option, that the executable file size is exactly the same as it was before. It's like the -static option did nothing. Also, I get the same error.
Would it be possible, if I move the required libraries into the runtime directory, to somehow have it find the libraries there, instead of looking for them in the standard spot?
Ok... well I exported that, and it seems to be working, however
It already wants more libraries that libstdc++.so.5 depends on, and I fear I will end up in a recursive dependency nightmare! Any idea how many dependent libraries, in total, libstdc++.so.5 requires? If it's more than a couple, I think I would like to pursue the --static route to solving my problem.
Do you have any suggestions why I the -static has no effect?
Well, I'm using the -c option for everything in my Makefile, so there shouldn't be any linking taking place anyway, right?
When I remove the -c options, and use -static, it bugs me for this:
cannot find -lstdc++
When I use both -c and -static, nothing is different than if I were to just use -c. And I don't think it makes sense (but I could be wrong) to use the -o option because I am doing lots of stuff in the Makefile:
just some hint:
>It already wants more libraries that libstdc++.so.5 depends on, and I fear
>I will end up in a recursive dependency nightmare! Any idea how many
>dependent libraries, in total, libstdc++.so.5 requires?
At the console, type ldd <nameofbinary>; this will dump the dependencies
of the file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.