title: The #include<iostream> exists, but I get an error: identifier "cout" is undefined. Why?
body: <p>I learn C++ and COM through the books.
  In the IDE MS Visual Studio 2012 I have created new empty C++ project, and added some existing files to it. My CPP file contains <code>#include&lt;iostream&gt;</code> row, but in editor I got such messages:</p>
  <blockquote>
  <p>Error: identifier &quot;cout&quot; is undefined</p>
  </blockquote>
  <p>end</p>
  <blockquote>
  <p>Error: identifier &quot;endl&quot; is undefined</p>
  </blockquote>
  <p>Code:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include&lt;iostream&gt;
  #include&quot;interfaces.h&quot; // unknown.h, objbase.h, initguid.h
  
  class CA {//: public IX, IY{
  public:
      // Constructor
      CA();
      // Destructor
      ~CA();
      // IUnknown
      virtual HRESULT __stdcall QueryInterface(const IID&amp; iid, void** ppv);
      virtual ULONG __stdcall AddRef();
      virtual ULONG __stdcall Release();
      // IX
      virtual void __stdcall Fx1();
      virtual void __stdcall Fx2();
      // IY
      virtual void __stdcall Fy1(){ cout &lt;&lt; &quot;Fy1&quot; &lt;&lt; endl; }  // errors here
      virtual void __stdcall Fy2(){ cout &lt;&lt; &quot;Fy2&quot; &lt;&lt; endl; }  // errors here also
  private:
      long counter;
  };
  </code></pre>
  <p>Why it happens?</p>