compilation error C++ : can not call member function without object
<p>I have the following main file where I tried to create a map with predefined value and pass it for further processing by other method. The main file is as is shown below :</p>

<pre><code>int main(){
  map&lt;id,Porto&gt; _portoInit;

  id = 1;

  Porto p;
  p.val = 5;

  _portoInit.insert(pair&lt;id, Porto&gt;(id, p));

  Porto::setPorto(_portoInit);

  return 1;
}
</code></pre>

<p>where the setPorto is defined under a class as the following (in seperate file)</p>

<pre><code>void Porto::setPorto( const map&lt;id,Porto&gt;&amp;  _portoblock ) {
   //do stuffs
};
</code></pre>

<p>I got prompted with an error of "error: cannot call member function ... without object"
Did not I declare the object of _portoInit in the main file already or it is a wrong way of declaration?</p>
