title: Error message: "setw is not defined" using g++
body: <p>I am trying to compile using gcc a project which earlier used SunStudio and am getting an error in the following code:</p>
  
  <pre><code>ostream &amp; operator &lt;&lt; ( ostream &amp; os, const UtlDuration &amp; d )
  {
      if ( d._nsec == 0 )
      {
          os &lt;&lt; d._sec &lt;&lt; " sec";
          return os;
      }
      else
      {
          cout.fill( '0' );
                  os &lt;&lt; d._sec &lt;&lt; "." &lt;&lt; std::setw(9) &lt;&lt; d._nsec &lt;&lt; " sec";
          cout.fill( ' ' );
          return os;
      }
  }
  </code></pre>
  
  <p>Error: “setw” is not a member of “std”</p>
  
  <p>I am not able to resolve this error can someone please explain me reason behind this error</p>