Forced to pass by value
<p>I just ported my code (originally written in msvc) to Code::Blocks (running GNU GCC) and I'm having a few problems in compiling my code.</p>

<p>The compiler is giving me an error when I try to pass a variable as an argument.</p>

<p>For example,</p>

<pre><code>void foo(int a, int b, int c){...}
//Works on calling like this:
foo(1,2,3);
//But not like this:
foo(x,y,z);
</code></pre>

<p>The compiler says that there is no matching function call to void foo(int &amp;a, int &amp;b, int &amp;c);</p>

<p>I don't want to make too many changes in my code, I've already cleaned the temporaries being passed as reference, which msvc allowed.</p>

<h3>Edit Copied from comment:</h3>

<pre><code>Index       i;
std::string s("...");

onPlayerInteraction(i,s);
</code></pre>

<blockquote>
  <p>error: no matching function for call to 'Object::onPlayerInteraction(Index&amp;, std::string)'<br>
  note: candidates are:<br>
  virtual void Object::onPlayerInteraction(Index, std::string&amp;) </p>
</blockquote>
