‘stoi’ was not declared in this scope
<p>So this error have been addressed several times, but no answers helped me. I'm using Notepad++ and Cygwin on windows 10. My code is as follows and it's from <a href="https://www.youtube.com/watch?v=Rub-JsjMhWY" rel="nofollow noreferrer">Derek Banas's 1 hour C++ tutorial</a>:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;string&gt;
#include &lt;fstream&gt;
#include &lt;cstdlib&gt;
#include &lt;sstream&gt; 
//#include &lt;stdlib.h&gt;
using namespace std;
int main(){
    string numberGuessed;
int intNumberGuessed = 0;
 do {
    cout &lt;&lt; "Guess between 1 and 10: ";
     getline (cin,numberGuessed);
     intNumberGuessed = stoi(numberGuessed);
    cout &lt;&lt; intNumberGuessed &lt;&lt; endl;
 } while (intNumberGuessed != 4);
   cout &lt;&lt; "You Win" &lt;&lt; endl;
    return 0;
}
</code></pre>

<p>and this is the error I get:</p>

<pre><code>$ g++ -std=c++11 -static ctut.cpp
ctut.cpp: In function ‘int main()’:
ctut.cpp:15:43: error: ‘stoi’ was not declared in this scope
      intNumberGuessed = stoi(numberGuessed);
</code></pre>

<p>You see I already have applied all the suggestions in previous answered threads. Is there anything I'm missing? Do I have to start using Ming? Since Notepadd++ is the one I found with the most upvotes in another topic here. This is what I found and tried but didn't work:
<a href="https://stackoverflow.com/questions/22084783/function-stoi-not-declared">Function stoi not declared</a></p>