CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2009
    Posts
    1

    Exclamation Is Visual Studio's 2008 Professional compadible with Windows 7

    I recently upgraded to windows 7 from Vista and redownloaded Visual Studio's Professional 2008 onto it. However, since then my programs won't let me use string varaibles with cout and cin.

    Here is a simple program example that won't compile

    #include<iostream>
    using namespace std;

    int main()
    {
    string test = "Hello";
    cout << test;
    return 0;
    }

    The error points to line with "cout" and says: error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

    So to me it seems to be a problem with the pre-defined <iostream> file where it defines the << operator. I have no clue how to fix this or why it happened. I didn't have this problem on Vista so I was wondering if Visual Studio's works on Windows 7? I have tried reinstalling Visual Studio 2008 multiple times but the problem still persists. Is the <iostream> file part of the Visual Studio installation or is it there when the operating system is installed?

    Does anyone have any answers?

  2. #2
    Join Date
    Apr 2005
    Posts
    107

    Re: Is Visual Studio's 2008 Professional compadible with Windows 7

    Uhhh...
    #include <string>

    Perhaps?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured