G++ and make - Stanford University
[Pages:22]g++ and make
Dan Wilson CS193 02/01/06
The g++ Compiler
? What happens when you call g++ to build your program?
? Phase 1, Compilation: .cpp files are compiled into .o object modules
? Phase 2, Linking: .o modules are linked together to create a single executable.
The Process
main.cpp Compiler
blurb.cpp
database.cpp
main.o
blurb.o
database.o
Linker
a.out
libraries
How g++ Does All This
? Calling: "g++ " ? When g++ is given .cpp files, it performs
both compilation and linking. If given .o files, it performs linking only. ? Assignment 1: "g++ *.cpp" ? Quick and easy, but not ideal. Who wants a program named "a.out?"
Options For g++ Compilation
? "-c": Compiles .cpp file arguments to .o but does not link (we'll need this for "make" later).
? "-g": Generates debugging information that is used by gdb-based debuggers
? "-I": Adds the directory to the list of directories searched for include files.
Compilation Options, cont.
? "-Wall": Directs g++ to give warnings about code that's probably in error.
? For example, it will catch and report: int number = GetRandomInteger() If (number = 6) std::cout ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- g and make stanford university
- do perfect english grammar
- make and do exercises language learning online
- mgmt 469 programming in stata creating do files
- expressions with take make do get clase de josé angel
- make or do exercise 3 perfect english grammar
- do or make exercise at auto english
- 4 at home with do make and take pearson elt
Related searches
- stanford university philosophy department
- stanford university plato
- stanford university encyclopedia of philosophy
- stanford university philosophy encyclopedia
- stanford university philosophy
- stanford university ein number
- stanford university master computer science
- stanford university graduate programs
- stanford university computer science ms
- stanford university phd programs
- stanford university phd in education
- stanford university online doctoral programs