The error is likely related to Replit's environment. You can consider these steps:
-Restart the Replit session or refresh the page, as temporary glitches can cause this issue.
-Create a new project and copy your code into it, as misconfigurations can happen in the environment.
-Check the compiler version by opening the Shell in Replit and running g++ --version.
If there's an issue with the compiler setup, this might help identify it.