An executable has a specific format (e.g. ELF) and architecture (e.g. x86). Thus, you do have to compile multiple times. However, it is possible to cross-compile to e.g. Windows 7 x86 and Mac OS X x86 from Ubuntu. The procedures for each are different, as you would expect.
For Windows, you will want mingw32. See Compile Windows C console applications in Linux .
For OS X, see How to compile Intel Mac binaries on Linux? , which links to a tutorial.
You can search to find more information on each.