Binary compatibility is somewhat a problem in linux actually.
If you statically link your binary then everything should be fine.
If you dynamically link it (ie. it uses the system libraries, like .dll's on windows) then it depends on having the same version as the version of the libraries it was built to target.
.deb and .rpm files are a bit different, in that they tell the package manager what the dependencies are and it will try to fetch them from your software repository.
This is all a moot point generally though, because 99% of the software you need is already in the distribution's repository, a sort of library of pre packaged software specifically for that distribution. All you do is open the sofware/package manager (called different things in different distributions, synaptic is common) and look for the package you want, and it will install it.
AMD AthlonX2 5000 black edition @2.8ghz, 4gb pc5400, AMD/ATi hd3850, creative xfi music, 24" hp widescreen 1920x1200 + 22" zalman trimon 3D 1680x1050, ECS KA3 MVP mobo