Next: Compiler: Weitere Optionen
Up: Die UNIX-Entwicklungsumgebung
Previous: Compiler
Anwendungsbeispiele
- g++ -g -o countdown countdown.cc
Der Compiler erzeugt mit dem Source-File countdown.cc das Programm
countdown (Option -o Der Compiler ruft den Linker auf.).
Es wird Debug-Information für das Programm erzeugt (Option -g).
- g++ -O -o countdown countdown.cc
Der Compiler erzeugt mit dem Source-File countdown.cc das
Programm countdown. Der Optimizer wird verwendet (Option -O).
- g++ -g -c countdown.cc
Der Compiler übersetzt das Programm in Object-Code, es wird jedoch
nicht der Linker aufgerufen. Das erzeugte File countdown.o ist
noch kein fertiges Programm.
- g++ -o countdown countdown.o
Der Compiler ruft nur den Linker auf, es entsteht das Programm
countdown.
- g++ -o pythagoras pythagoras.cc -lm
Der Compiler übersetzt das Source-File und erzeugt das Programm
pythagoras. Es wird die Programmbibliothek (Library) libm
verwendet.
Next: Compiler: Weitere Optionen
Up: Die UNIX-Entwicklungsumgebung
Previous: Compiler