How to change default output file of g++? September 18, 2023 by Tarik You need to use the -o option of g++ g++ -o output_file_name source.cpp