1

Many multi-platform applications seem to have common source code. How do builds generate platform specific binaries?
Is it possible to build say, a windows binary on linux or mac?

durron597
  • 31,968
  • 17
  • 99
  • 158
roshanvid
  • 793
  • 6
  • 21

2 Answers2

0

It's possible if you have an appropriate cross-compiler and libraries. For example, many programs which are available on both Linux and Windows use the MinGW toolchain on Windows, which includes a library that emulates POSIX functions using Win32 functions.

geekosaur
  • 59,309
  • 11
  • 123
  • 114
0

The platform a binary is compiled to run on depends on the compiler and generally, one can have the compiler compile for a target system. To that end, yes it is generally possible to compile for a system other than the one you are running on. Though you are usually better off compiling for a target system on that system.

zellio
  • 31,308
  • 1
  • 42
  • 61