Error message: “setw is not defined” using g++ September 6, 2023 by Tarik You need to include the header which declares it: #include <iomanip>