C - Compilieren: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(→Run) |
|||
| Zeile 1: | Zeile 1: | ||
| + | =Compilere installieren= | ||
| + | ;Debian | ||
| + | *sudo apt install -y gcc | ||
| + | ;Rocky | ||
| + | *sudo dnf install -y gcc | ||
| + | |||
=Sourcecode= | =Sourcecode= | ||
*cat hello-world.c | *cat hello-world.c | ||
Aktuelle Version vom 24. August 2026, 12:43 Uhr
Compilere installieren
- Debian
- sudo apt install -y gcc
- Rocky
- sudo dnf install -y gcc
Sourcecode
- cat hello-world.c
#include <stdio.h>
int main(void)
{
puts("Hallo Welt!");
}
Compile
- gcc hello-world.c -o hello-world
Result
file *
hello-world: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked ... hello-world.c: C source, ASCII text
Run
- ./hello-world
Hallo Welt!
Cross Compiler
- apt install mingw-w64
- x86_64-w64-mingw32-gcc -o hello-world.exe hello-world.c