I assume you use MinGW (GCC fork for Windows) and that version did unfortunately not support stoi and other similar string functions. The original mingw project at mingw.org seems kind of dead because it hasn't been updated in many years. The latest version of Code::Blocks comes with TDM-GCC but I have no idea if it supports stoi or not.
For the most up-to-date version GCC on Windows I think you should use Mingw-w64 (another MinGW fork). It should support stoi as far as I have heard. https://mingw-w64.org/