title: ifstream error with g++ but compiles with Visual Studio
body: <p>I have been using Visual Studio for a project I am working on, though it must also compile with GCC on Linux. I have completed my project and it runs fine, but I sent the files over to my Linux shell and I receiving an error with a trivial line of code:</p>
  
  <pre><code>std::ifstream input(s);
  </code></pre>
  
  <p>This gives me error saying there is no matching function. <code>s</code> is an <code>std::string</code> by the way.
  Can anyone enlighten me why this runs under Visual Studio but not GCC, even though I am looking at the documentation for ifstream? Perhaps an old version of GCC?</p>
  
  <p><strong>EDIT</strong>: GCC version is 4.2.1  The exact error is: </p>
  
  <pre><code>error: no matching function for call to 'std::basic_ifstream&lt;char,  
  std::char_traits&lt;char&gt;&gt;::basic_ifstream(std::string&amp;)'
  </code></pre>
  
  <p><strong>EDIT 2:</strong> Relevant code:</p>
  
  <pre><code>std::string s = "";
  if(argc == 2)
      s = argv[1];
  else{
      std::cout &lt;&lt; "Bad filename?" &lt;&lt; std::endl;
      return 1;
  }
  std::ifstream input(s);
  </code></pre>