title: Eclipse g++ not found in path: windows
body: <p>I am attempting to setup SDL2 for C++ with Eclipse on Windows 7.</p>
  
  <p>In order to do so, I am following the tutorial in <a href="http://zamma.co.uk/setup-sdl2-eclipse-windows/" rel="nofollow noreferrer">this link</a>, which states that I must first install MinGW. So I follow the <a href="http://zamma.co.uk/installing-mingw-windows/" rel="nofollow noreferrer">link</a> provided in order to setup MinGW. I follow all the steps without issue. I then open Eclipse and attempt to build a simple hello world program:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
      cout &lt;&lt; "Hello World!" &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>To my surprise, this code doesn't build, with 6 errors.</p>
  
  <p>I then proceed to simplify the program further:</p>
  
  <pre><code>int main()
  {
      return 0;
  }
  </code></pre>
  
  <p>This also does not compile. There are two errors:</p>
  
  <ol>
  <li>Program "g++" not found in PATH</li>
  <li>Program "gcc" not found in PATH</li>
  </ol>
  
  <p>Here is a screenshot.
  <a href="https://i.stack.imgur.com/EZagI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EZagI.png" alt="build errors"></a></p>
  
  <p>However, my path does contain "C:\mingw\bin". I have also tried changing this to "C:\mingw". Looking inside "C:\mingw\bin", I find gcc and g++:<a href="https://i.stack.imgur.com/TczJi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TczJi.png" alt="gcc and g++ in mingw\bin"></a></p>
  
  <p>In addition, compiling a test program using the command line (g++ Test.cpp -o Test) works just fine, as does "g++ -v".</p>
  
  <p>I have been searching the web for hours, and can't seem to find an answer as to why Eclipse can't seem to compile anything with MinGW. Questions I have looked at on SO (which haven't been able to fix my issue) include:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/18686064/eclipse-mingw-binary-not-found">Eclipse mingw binary not found</a></li>
  <li><a href="https://stackoverflow.com/questions/22948320/eclipse-not-finding-std-c-libraries">Eclipse not finding c std libraries</a></li>
  <li><a href="https://stackoverflow.com/questions/18477725/program-g-not-found-in-path">g++ not found in path</a></li>
  <li><a href="https://stackoverflow.com/questions/11703432/eclipse-c-program-g-not-found-in-path">Eclipse C++ : "Program g++ not found in PATH"</a></li>
  <li><a href="https://stackoverflow.com/questions/12609482/program-g-not-found-in-path">Program g++ not found in path</a></li>
  <li><a href="https://stackoverflow.com/questions/21323334/program-g-not-found-in-path-c">Program g++ not found in path C++ [duplicate]</a></li>
  <li><a href="https://stackoverflow.com/questions/13565614/eclipse-cdt-juno-in-win7-cannot-find-g-in-path-iostream-unresolved-and-oth">Eclipse CDT (Juno) in Win7: Cannot find g++ in PATH, iostream unresolved and other fun stuff</a></li>
  </ol>
  
  <p><strong>Additional info:</strong>
  Window > Preferences > C/C++ > Build > Settings > "CDT GCC Built-in Complier Settings MinGW [Shared]" : <em>Toolchain MinGW GCC is not detected on this system</em>.</p>
  
  <p>I have also reinstalled Eclipse to no avail.</p>
  
  <p>I realize that this may be a duplicate question of some that I have linked, but the information in previous questions have not been able to fix my problem, and I fear that adding a comment to an old question may not result in an answer.</p>
  
  <p><em>Please request additional information as needed.</em></p>