Wie findet ein C-Compiler, dass -lm auf die Datei libm.a verweist?
Was sind .a-Dateien in C-Programmierung unter Linux? Ist es eine Bibliotheksdatei?
To merge with the math library libm.a you would type
cc -o program_name prog.c -lm
when you compile the program. The -lm means: add in libm. If we wanted to add in the socket library libsocket.a to do some network programming as well, we would type
cc -o program_name prog.c -lm -lsocket
and so on.
Hier findet der Compiler, dass -lm auf die Datei libm.a und -lsocket als libsocket.a verweist?
Und wenn wir die Header-Datei zum Programm hinzufügen, müssen wir beim Kompilieren die Bibliothek erwähnen?