Reputation: 2518
I'm cross-compiling a C++ program. But when I try to run on the target computer it can't find the C++ libs (namely libstdc++.so.5).
Is there a way to bundle all the dependencies so I can run on the target computer?
Or do I have to install them on the target computer?
Upvotes: 2
Views: 74
Reputation: 168596
Try g++ -static x.cc -o x
. This will link all of your libraries, including libstdc++, into your executable.
Of course, the resulting image will be larger than a dynamically-linked image.
Upvotes: 4