Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8774381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:33:12+00:00 2026-06-13T18:33:12+00:00

I learn C++ and COM through the books. In the IDE MS Visual Studio

  • 0

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 #include<iostream> row, but in editor I got such messages:

Error: identifier "cout" is undefined

end

Error: identifier "endl" is undefined

Code:

#include<iostream>
#include"interfaces.h" // unknown.h, objbase.h, initguid.h

class CA {//: public IX, IY{
public:
    // Constructor
    CA();
    // Destructor
    ~CA();
    // IUnknown
    virtual HRESULT __stdcall QueryInterface(const IID& 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 << "Fy1" << endl; }  // errors here
    virtual void __stdcall Fy2(){ cout << "Fy2" << endl; }  // errors here also
private:
    long counter;
};

Why it happens?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:33:14+00:00Added an answer on June 13, 2026 at 6:33 pm

    You need to specify the std:: namespace:

    std::cout << .... << std::endl;;
    

    Alternatively, you can use a using directive:

    using std::cout;
    using std::endl;
    
    cout << .... << endl;
    

    I should add that you should avoid these using directives in headers, since code including these will also have the symbols brought into the global namespace. Restrict using directives to small scopes, for example

    #include <iostream>
    
    inline void foo()
    {
      using std::cout;
      using std::endl;
      cout << "Hello world" << endl;
    }
    

    Here, the using directive only applies to the scope of foo().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to work through this tutorial to learn ember - http://www.tuanleaded.com/blog/2012/04/getting-started-with-ember-js-the-missing-to-dos-manual/ I have
I have started to learn jQuery and am going through some very simple examples
I'm new to jqgrid and I have learn many things through your answer. Now
I have created a project on GitHub so I can learn how to optimize
Hi I have been trying to learn Javascript using codeacademy.com and I have reached
I was going through this tutorial in order to learn how Django works: https://docs.djangoproject.com/en/dev/intro/tutorial01/
I am currently going through the tutorial examples on http://code.google.com/p/stanford-cs193g-sp2010/ to learn CUDA. The
I am trying to learn Spring MVC by following through some of the examples
Hi guys I'm running through this tutorial: http://www.sencha.com/learn/a-sencha-touch-mvc-application-with-phonegap and trying to get the code
I am brand new to Android development and have gotten through these two resources

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.