title: #include skipped when looking for precompiled header use -- unexpected end of file while looking for precompiled header
body: <p>I have some code but it wan't compile. I can't go further with this example because this error raises every time I try to debug. 
  Note: I am Java programmer, and this message in VS is strange and I coudn't find what is problem. Can someone explain me what this error mean?</p>
  
  <p>Here is code:</p>
  
  <p>zadatak.cpp:</p>
  
  <pre><code>// zadatak.cpp : Defines the entry point for the console application.
  //
  
  #include "stdafx.h"
  #include "String.h"
  #include &lt;iostream&gt;
  using namespace std;
  
  void main()
  {
      String s1(20),s2(20);
      cout&lt;&lt;"Unesi prvi string."&lt;&lt;endl;
      cin&gt;&gt;s1;
      cout&lt;&lt;"Unesi drugi string."&lt;&lt;endl;
      cin&gt;&gt;s2;
      ++s1;
      s2++;
      String s3(40);
      s3=s1+s2;
      cout&lt;&lt;"Treci string: "&lt;&lt;s3&lt;&lt;endl;
  }
  </code></pre>
  
  <p>String.cpp:</p>
  
  <pre><code>#include "String.h"
  #include &lt;iostream&gt;
  using namespace std;
  #include &lt;string.h&gt;
  
  String::String(void)
  :duzina(0)
  {
      niz=new char[duzina];
  }
  
  String::String(int br)
  :duzina(br)
  {
      this-&gt;niz=new char[duzina];
  }
  
  String::~String(void)
  {
      delete [] niz;
  }
  
  String::String(String&amp; s)
  :duzina(s.duzina)
  {
      this-&gt;niz=new char[this-&gt;duzina];
      for(int i=0; i&lt;this-&gt;duzina; i++)
          this-&gt;niz[i]=s.niz[i];
  }
  
  void String::nadjiPocetak(char rec[])
  {
      int poc=0;
      for(int i=0; i&lt;this-&gt;duzina; i++)
      {
          int duz=0;
          if(this-&gt;niz[i]==rec[0])
          {
              int l=strlen(rec);
              for(int j=0; j&lt;l; j++)
                  if(this-&gt;niz[i+j]==rec[j])
                      duz+=1;
          }
          if(duz==strlen(rec))
              poc=i;
      }
      if(poc==0)
          cout&lt;&lt;"U stringu ne postoji zadati string."&lt;&lt;endl;
      else
          cout&lt;&lt;"Pocetak je na poziciji: "&lt;&lt;poc+1&lt;&lt;endl;
  }
  
  /*void String::ucitaj()
  {
      cout&lt;&lt;"Unesi string"&lt;&lt;endl;
      cin&gt;&gt;this-&gt;niz;
  }
  
  void String::prikazi()
  {
      cout&lt;&lt;"String: "&lt;&lt;this-&gt;niz&lt;&lt;endl;
  }*/
  
  String&amp; String::operator+ (String s)
  {
      String *s1;
      s1=new String(duzina+s.duzina);
      strcpy(s1-&gt;niz,niz);
      strcat(s1-&gt;niz,s.niz);
      return *s1;
  }
  
  String&amp; String::operator++ ()
  {
      if(niz[0]&gt;='a' &amp;&amp; niz[0]&lt;='z')
          niz[0]='A'+niz[0]-'a';
      return *this;
  }
  
  String&amp; String::operator++ (int n)
  {
      for(int i=0; i&lt;duzina; i++)
          if(niz[i]&gt;='a' &amp;&amp; niz[i]&lt;='z')
              niz[i]='A'+niz[i]-'a';
      return *this;
  }
  
  String&amp; String::operator= (String&amp; s)
  {
      duzina=s.duzina;
      delete [] niz;
      niz=new char[duzina];
      strcpy(niz,s.niz);
      return *this;
  }
  
  istream&amp; operator&gt;&gt; (istream&amp; in, String&amp; s)
  {
      in&gt;&gt;s.niz;
      return in;
  }
  
  ostream&amp; operator&lt;&lt; (ostream&amp; out, String&amp; s)
  {
      out&lt;&lt;s.niz;
      return out;
  }
  </code></pre>
  
  <p>String.h:</p>
  
  <pre><code>#pragma once
  #include &lt;iostream&gt;
  using namespace std;
  
  class String
  {
  private:
      int duzina;
      char* niz;
  public:
      String(void);
      String(int br);
      ~String(void);
      String(String&amp; s);
      int vratiDuzinu() {return this-&gt;duzina;}
      void nadjiPocetak(char rec[]);
      //void ucitaj();
      //void prikazi();
      String&amp; operator+ (String s);
      String&amp; operator++ ();
      String&amp; operator++ (int n);
      String&amp; operator= (String&amp; s);
      friend istream&amp; operator&gt;&gt; (istream&amp; in, String&amp; s);
      friend ostream&amp; operator&lt;&lt; (ostream&amp; out, String&amp; s);
  };
  </code></pre>
  
  <p>Error that Visual Studio gives in output is:</p>
  
  <blockquote>
    <p>1>------ Build started: Project: zadatak, Configuration: Debug Win32------<br>
    1>Build started 12/13/2011 02:44:50 AM.<br>
    1>InitializeBuildStatus:<br>
    1>  Touching "Debug\zadatak.unsuccessfulbuild".<br>
    1>ClCompile:<br>
    1>  All outputs are up-to-date.<br>
    1>  zadatak.cpp<br>
    1>  String.cpp<br>
    1>c:\users\ivo\documents\visual studio 2010\projects\zadatak\zadatak\string.cpp(1): warning C4627: '#include "String.h"': skipped when looking for precompiled header use<br>
    1>       Add directive to 'StdAfx.h' or rebuild precompiled header<br>
    1>c:\users\ivo\documents\visual studio 2010\projects\zadatak\zadatak\string.cpp(2): warning C4627: '#include ': skipped when looking for precompiled header use<br>
    1>       Add directive to 'StdAfx.h' or rebuild precompiled header<br>
    1>c:\users\ivo\documents\visual studio 2010\projects\zadatak\zadatak\string.cpp(4): warning C4627: '#include ': skipped when looking for precompiled header use<br>
    1>       Add directive to 'StdAfx.h' or rebuild precompiled header<br>
    1>c:\users\ivo\documents\visual studio 2010\projects\zadatak\zadatak\string.cpp(108): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?<br>
    1>  Generating Code...<br>
    1><br>
    1>Build FAILED.<br>
    1><br>
    1>Time Elapsed 00:00:00.41<br>
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========</p>
  </blockquote>