I’ve successfully compiled a program (including SDL) on my computer (Ubuntu 12) and the a.out runs just fine!
Now, if I send the a.out to a friend, it just does not work. (gives simple error message ("Can't be run..") or something)
But if I compile the corresponding source-file on my friends computer again, it works!
How do I have to pack/compile/make my program to make it runnable on other computer?
Executable are often specific to the environment/machine they were created on. Even if the same processor/hardware is involved, there may be dependencies on libraries that may prevent executables from just running on other machines.
Can you just send the source code with instructions to compile? Assuming there is no NDA or other issues preventing that approach (I only suggest that since you mentioned this worked for you)
Of course, in the end it is possible, after all that’s how binaries are distributed, but they will be carefully constructed and will have statically linked libraries (ie everything is part of the executable).