首页 > C/C++ > error C2653: ’std’ : is not a class or namespace name

error C2653: ’std’ : is not a class or namespace name

2010年4月28日 huubby 发表评论 阅读评论

Today, when I created a Win32 Console Application in VS2005, and wrote the code as below


#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
std::string    str = "";
str += "helllo";
str += "world";

printf("%s", str);
return 0;
}

I got compile errors:

error C2653: ’std’ : is not a class or namespace name

At the beginning, I thought it caused by a static library on which my new project depended. Then, I removed the static library dependent, but it didn’t work.

As you know, googling is a final solution when you find something you cann’t solve. I google it and figure it out. It’s simple, as MS has a bug in this situation.

You can find why this happend here, a relational situation about the issue is here.

Over!

分类: C/C++ 标签: ,
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.