title: Trying to set up the GNU C++ COMPILER, but I get an error I don't understand when I try to compile hello.cpp
body: <p>So I bought this book called <a href="https://rads.stackoverflow.com/amzn/click/com/1840784326" rel="nofollow noreferrer" rel="nofollow noreferrer">C++ Programming In Easy Steps by Mike McGrath</a> online. </p>
  
  <p>In the instructions it specifies to create a source file written in C++, the infamous "helo world". So I created my cpp file through sublime text editor and moved it to a file called MyPrograms in my C directory. 
  The code is as follows:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using std::cout;
  using std::endl;
  
  
  int main()
  {
  cout &lt;&lt; "hello world"&lt;&lt; endl ; 
  return 0 ;
  }
  </code></pre>
  
  <p>I have also tried:
      #include 
      using namespace std;</p>
  
  <pre><code>int main()
  {
  cout &lt;&lt; "hello world"&lt;&lt; endl ; 
  return 0 ;
  }
  </code></pre>
  
  <p>Ok so I saved this file as hello.cpp in C:\MyPrograms.
  Then here is where the error occurs....
  I open cmd. 
  I do "c++"
  I receive the message "c++: no input files".Which is what I'm supposed to recieve according to the book. 
  I proceed to do "cd\myprograms" to enter into the MyPrograms directory.
  Once in that directory I do "c++ hello.cpp". According to the book this is supposed to compile my source file and create an executable file next to it. Instead I get a long error message that end in collect 2: 1d returned 1 exit status.</p>
  
  <p>When I visit MyPrograms no executable file has been made next to the original cpp file. 
  I have also tried to do "c++ hello.cpp -o hello.exe" but it gives me the error again. All of this is done on the command prompt. <img src="https://i.stack.imgur.com/C1gqc.png" alt="The command prompt error"></p>
  
  <p>Please help :(</p>