title: Why would the order of the parameters of compling produce warning?
body: <p>I was coding a very simply program which is basically hello world:</p>
  <pre><code>#include &lt;string&gt;
  #include &lt;vector&gt;
  
  int main() {
    std::vector&lt;std::string&gt; vec = {&quot;Hello&quot;, &quot;World&quot;};
    for (const auto &amp;num : vec) {
      std::cout &lt;&lt; num &lt;&lt; std::endl;
    }
  
    return 0;
  }
  </code></pre>
  <p>Then I use a shell command to compile and execute the file:</p>
  <pre><code>echo &quot;Start compling: &quot;
  g++ -std=c++11 -Werror -o test test.cpp
  echo &quot;File complied!&quot;
  echo &quot;Start excuting: &quot;
  ./test
  echo &quot;Program stopped&quot;
  </code></pre>
  <p>In this way, everything is fine. But if I change the second command into:</p>
  <pre><code>g++ -std=c++11 -o -Werror test test.cpp
  </code></pre>
  <p>The compiler gives me such warnings ( which I treat as errors ) :</p>
  <pre><code>Start compling: 
  /usr/bin/ld: test: _ZSt4cout: invalid version 2 (max 0)
  /usr/bin/ld: test: error adding symbols: bad value
  collect2: error: ld returned 1 exit status
  File complied!
  Start excuting: 
  Hello
  World
  Program stopped
  </code></pre>
  <p>I really can't figure out why the order of the parameters would cause this.</p>