C - dynamic linked vs. static linked: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 13: | Zeile 13: | ||
Hallo Welt! | Hallo Welt! | ||
*ldd hello.dynamic | *ldd hello.dynamic | ||
| + | <pre> | ||
linux-vdso.so.1 (0x00007ffdebfc2000) | linux-vdso.so.1 (0x00007ffdebfc2000) | ||
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc8da2a8000) | libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc8da2a8000) | ||
/lib64/ld-linux-x86-64.so.2 (0x00007fc8da489000) | /lib64/ld-linux-x86-64.so.2 (0x00007fc8da489000) | ||
| + | </pre> | ||
Version vom 18. September 2022, 16:38 Uhr
Hello World Code in C
#include <stdio.h>
int main(void)
{
puts("Hallo Welt!");
}
Dynamisches Kompilieren und linken
- gcc hello.c -o hello.dynamic
- ./hello.dynamic
Hallo Welt!
- ldd hello.dynamic
linux-vdso.so.1 (0x00007ffdebfc2000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc8da2a8000) /lib64/ld-linux-x86-64.so.2 (0x00007fc8da489000)