0

The problem is really strange for me.

The code is as simple as possible:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello World!" << endl;
    return 0;
}

It is just helloworld as it is created from standart cpp project. I am sure it was worked. But after some time (really don't remember what have chaged...) I got an error:

error: explicit qualification in declaration of 'std::cout'
   extern ostream std::cout;  /// Linked to standard output

funny thing that is not in the project but inside iostream

some help? ^_^

.new information.: I was building boost library and for many of files I am getting the same error: explicit qualification in declaration of 'std::cout'

I use MinGW

Alexander Lyapin
  • 305
  • 1
  • 14

1 Answers1

1

The only explanations that come to mind are:

  1. Someone modified the standard header (accidentally?), replacing the original

    extern ostream cout;
    

    with incorrect

    extern ostream std::cout;
    
  2. Someone defined a macro named cout as std::cout, most likely in the compiler's command line. E.g.

    -Dcout=std::cout
    

    See http://coliru.stacked-crooked.com/a/bc5be8c7d99fed53 for example.

AnT stands with Russia
  • 312,472
  • 42
  • 525
  • 765
  • You are the man! Thank you! Can you imagine, I was using refactoring to change cout with std::cout... and it was also changed inside of iostream... Stupid user))) – Alexander Lyapin Sep 29 '17 at 07:13