- CS2141 – Software Development using C/C++
Compiling a C++ Program 2
- #include <iostream>
using namespace std; int main( ) { cout << “Hello world!” << endl; }
g++ hello.C
- a.out
./a.out Compiling a C++ Program 3
- o
> g++ -o hello hello.C > ./hello Hello world!
!
- g
- Wall!
" > g++ -g -Wall -o hello hello.C
Compiling a C++ Program 4
- #"
- > g++ -o quack quack.C moo.C
$%
- c
> g++ -c quack.C > g++ -c moo.C
quack.omoo.o