title: MinGW .exe requires a few gcc dll's regardless of the code?
body: <p>When compiling with MinGW, I have to copy over certain dll files from the MinGW bin directory before the exe will run (Even when using "-static" and/or "-static-libstdc++".)
  How do I change that? Is there a special build of MinGW that I have to use? Ultimately I want to be able to run the program with nothing but the exe in the directory (and no windows environment variables set.) These File's are:</p>
  
  <ul>
  <li>libstdc++-6.dll</li>
  <li>libgcc_s_seh-1.dll</li>
  <li>libwinpthread-1.dll</li>
  </ul>
  
  <p>And here is the complete list of step's I fallow:</p>
  
  <ol>
  <li>Open Up Code::Blocks</li>
  <li>Select "File->New->Project->Console"</li>
  <li>Fill out the project settings for project "Hello World"</li>
  <li>Right click Project->Build Options...->Hello World (Root target)->Other Options</li>
  <li>Enter "-static" (or "-static-libstdc++") under the already set "-fexceptions"</li>
  <li>CTRL-F9 : Build Project (Without executing)</li>
  <li>Navigate to, in Windows Explorer, and run the built "Hello World.exe" file.</li>
  <li>Click "OK" when a message pop's up saying "Error: libstdc++-6.dll is missing from your computer."</li>
  <li>Copy "libstdc++-6.dll" from the /MinGW/bin/ directory, into the "Hello World.exe" directory.</li>
  <li>Run "Hello World.exe"</li>
  <li>Click "OK" for the message saying "Error: libgcc_s_seh-1.dll is missing from your computer."</li>
  <li>Copy "libgcc_s_seh-1.dll" into the "Hello World.exe" directory.</li>
  <li>Repeat and end up copying "libwinpthread-1.dll" over aswell.</li>
  <li><p>View the message</p>
  
  <pre><code>Hello World!
  </code></pre></li>
  </ol>
  
  <p><strong>Edit:</strong>
  My command line is:</p>
  
  <pre><code>g++.exe -Wall -fexceptions -static -static-libgcc -static-libstdc++ -g -static-libgcc -static-libstdc++ -L. -c "C:\Users\______\Desktop\Hello World\main.cpp" -o obj\Debug\main.o
  g++.exe -o "bin\Debug\Hello World.exe" obj\Debug\main.o
  </code></pre>
  
  <p>With all the dll files mentioned above required. And, just to be safe, the code is:</p>
  
  <pre><code>// main.cpp
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      cout &lt;&lt; "Hello world!" &lt;&lt; endl;
      return 0;
  }
  </code></pre>