Expected primary-expression before ‘int map iterator declaration
<p>I dont know why im getting this error:</p>

<pre><code>src/Cronologia.cpp: In member function ‘void Cronologia::recuento()’:
src/Cronologia.cpp:106:9: error: expected primary-expression before ‘int’
     map&lt;int,EventoHistorico&gt; ::const_iterator itm;
         ^
src/Cronologia.cpp:106:9: error: expected ‘;’ before ‘int’
</code></pre>

<p>So my iterator its not being declared, and I get more error of no declaration.</p>

<p>Here is my code:</p>

<pre><code>void Cronologia::recuento()
{
    int map = cronologias.size();
    cout &lt;&lt; "Numero de anios: " &lt;&lt; map &lt;&lt; endl;
    map&lt;int,EventoHistorico&gt; ::const_iterator itm;
    for(itm=cronologias.begin();itm!=cronologias.end();++itm)
    {
            cout &lt;&lt; "Anio: " &lt;&lt; (*itm).first;
            cout &lt;&lt; "Numero de eventos: " &lt;&lt; (*itm).second.size() &lt;&lt; endl;
    }
}
</code></pre>

<p>Its weird because Im declaring the same thing in other function, and getting no errors:</p>

<pre><code>Cronologia Cronologia::filtrarIntervalo(int inf, int sup)
{
    Cronologia result;
    map&lt;int,EventoHistorico&gt;::const_iterator itinf, itsup;
    itinf = cronologias.find(inf);
    itsup = cronologias.find(sup);
}
</code></pre>