Running a.out on another computer

I successfully compiled the program (including SDL) on my computer (Ubuntu 12), and it a.outworks fine!

Now, if I send to a a.outfriend, it just doesn't work. (gives a simple error message ( "Can't be run..") or something else) But if I again compile the corresponding source file on my computer for friends, it will work!

How can I pack / compile / make my program to run it on another computer?

+5
source share
2 answers

Executables often refer to the environment / machine on which they were created. Even if the same processor / hardware is involved, there may be library dependencies that may prevent executable files from running on other machines.

Can you just send the source code with instructions for compiling? Assuming there are no NDAs or other issues that impede this approach (I only suggest that since you mentioned that this worked for you)

Of course, in the end, it’s possible after the binary files are distributed, but they will be carefully designed and have statically linked libraries (i.e. everything is part of the executable file).

+5
source

Ask your friend to do the following:

 chmod +x a.out
 ldd a.out

? , , (, Ubuntu ..).

0

All Articles