Try
g++ -Wall -O2 main.cpp a.cpp b.cpp
This will create a program a.out
which is the executable. The -Wall
flag just tells the compiler to issue more warnings, and the -O2
flag enables optimizations. The last three arguments are your source files. You need to give all source files that are not #include
:d in any way to g++
.
You can specify the executable name with the option -o (name)
.