title: gcc 4.8.2 cc1plus: error: unrecognized command line option "-std=gnu++11"
body: <p>I have a system in which I've been compiling programs with C++11 using automake and everything has been working.</p>
  
  <p>However, when a different user take the same exact Makefile they get the aforementioned error.</p>
  
  <p>Now, if they type in <code>g++ --std=gnu++11 program.cpp</code> then there are no complaints.</p>
  
  <p>I've narrowed it down to a line that is causing the issue; however, I don't know how to fix it.</p>
  
  <pre>
  depbase=`echo no_endl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
          g++ -DHAVE_CONFIG_H -I. -I../..    -g --std=gnu++11 -g -O2 -MT no_endl.o -MD -MP -MF $depbase.Tpo -c -o no_endl.o no_endl.cpp &&\
          mv -f $depbase.Tpo $depbase.Po
  
  </pre>
  
  <p>The problem is with <code>depbase</code>; however, I don't know what is going on with it or why it is there.</p>
  
  <p>Below is the Automake file that I used to generate the Makefile:</p>
  
  <pre><code>bin_PROGRAMS = no_endl
  AM_CXXFLAGS = -g --std=gnu++11
  no_endl_SOURCES = no_endl.cpp
  </code></pre>
  
  <p>The only difference between my g++ and their g++ is I have an alias so <code>g++</code> turns into <code>g++ -g</code>.</p>
  
  <p>Helpful information</p>
  
  <pre><code>g++ --version                                                          
  g++ (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
  Copyright (C) 2013 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  </code></pre>
  
  <p>If there is any other information that I need to provide, then let me know.</p>
  
  <p><a href="https://stackoverflow.com/questions/36678263/cc1plus-error-unrecognized-command-line-option-std-gnu11">Related Question</a></p>