This is a portable binary executable.

After compiling the C program, I can take the binary executable and run it on another system where gcc is not loaded, for example, the Ubuntu field?

+5
source share
5 answers

Partly true. Yes, you do not need the compiler itself, but you need the C runtime library. In any case, both the C compiler and the C environment are part of POSIX, so you cannot find a Unix system without them.

+2
source

Technically: yes, but use a static link if you need maximum portability


, gcc, . , , , , .

, , linux to linux. . DLL-.

. , ( ), .

+8

gcc C , , , . , (, C-runtime, posix, Win32), , Ubuntu, Ubuntu, ​​gcc, Windows unixes (, Solaris HPUX).

C Java #, , (JVM/CLR). (Perl/Python/JavaScript), script , .

+4

, . , 32- Linux 64- Windows, Ubuntu ubuntu, .

+3

Depends on the platforms and libraries installed on the platform. A compiled executable will most likely be dynamically related dependencies between libraries, for example, libcand what was associated with it at compile time.

What platforms / compilers are involved and where do you want to move this binary?

+2
source

All Articles