Table of Contents

1. Building your program with g++

Make sure your terminal is in the correct directory that contains your C++ source files. Use the ls command to check what files are available:

vscode_build_terminal_gpp.png

You can build your program in several different ways:

Command Effect
g++ FILENAME.cpp Builds just one C++ file into a.out or a.exe
g++ FILENAME.cpp -o program.exe Builds just one C++ file into a program named program.exe
g++ *.cpp *.h Build all .cpp and .h source files into a.out or a.exe
g++ *.cpp *.h -o program.exe Build all .cpp and .h source files into program.exe

Author: RachelWil

Created: 2026-07-06 Mon 12:40

Validate