1

So if I add iostream (VS 2010 express) I get these errors, can't find much on google, any ideas, didn't used to be like this, a I have is this...

#include "stdafx.h"
#include <iostream>

int _tmain(int argc, _TCHAR* argv[])
{
    return 0;
}

When I try to build, I get the following error messages:

------ Rebuild All started: Project: test, Configuration: Debug Win32 ------
  stdafx.cpp
  test.cpp
c:\program files\microsoft visual studio 10.0\vc\include\utility(535): error C2039: 'get' : is not a member of 'std::tr1'
c:\program files\microsoft visual studio 10.0\vc\include\utility(535): error C2873: 'get' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 10.0\vc\include\utility(536): error C2039: 'tuple_element' : is not a member of 'std::tr1'
c:\program files\microsoft visual studio 10.0\vc\include\utility(536): error C2873: 'tuple_element' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 10.0\vc\include\utility(537): error C2039: 'tuple_size' : is not a member of 'std::tr1'
c:\program files\microsoft visual studio 10.0\vc\include\utility(537): error C2873: 'tuple_size' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 10.0\vc\include\ios(236): error C2039: 'hexfloat' : is not a member of 'std::tr1'
c:\program files\microsoft visual studio 10.0\vc\include\ios(236): error C2873: 'hexfloat' : symbol cannot be used in a using-declaration
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Jerry Coffin
  • 476,176
  • 80
  • 629
  • 1,111
rams6
  • 31
  • 1
  • Try to change the order of `includes`. – Hemant Gangwar Nov 04 '14 at 19:58
  • 1
    Have you tried removing `#include "stdafx.h"`? It's not needed and in my experience, more trouble than its worth. – Thomas Matthews Nov 04 '14 at 19:58
  • @Learner stdafx.h must come first otherwise everything is even worse – M.M Nov 04 '14 at 20:00
  • I am not 100% sure the answer, but one thing I would try adding: using namespace std; – Jonathan Nov 04 '14 at 20:02
  • @Jonathan Shudder .... – πάντα ῥεῖ Nov 04 '14 at 20:05
  • I know many tend to consider using namespace std; bad practice: http://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice?s=1|3.9018 however, it would at least be a good debug step to see if it resolves the compiler errors here (especially since they include std:: in the error) – Jonathan Nov 04 '14 at 20:16
  • If none of the above works, I would take a look at the second (accepted) answer to the question here, it looks like it might be related to this error: http://stackoverflow.com/questions/6737092/shared-ptr-not-defined-when-including-from-managed-code – Jonathan Nov 04 '14 at 20:23
  • I tried these thing, add using namespace std and switch the order or iostream etc.. same error, never seen this error before. – rams6 Nov 05 '14 at 02:12
  • Well for anyone reading, I just uninstalled VS and also the windows SDK(manually) now it works. – rams6 Nov 08 '14 at 13:22

0 Answers0