tstring typedef问题
我有一个问题,试图自己键入一个非常方便的tstring(见下文)
#ifndef _NISAMPLECLIENT_H_
#define _NISAMPLECLIENT_H_
#include <windows.h>
#include <stdlib.h>
using namespace std; // ERROR here (1)
#ifdef _UNICODE
#define CommandLineToArgv CommandLineToArgvW
#else
#define CommandLineToArgv CommandLineToArgvA
#endif
typedef basic_string<TCHAR> tstring; // ERROR HERE (2)
尝试编译时出现编译器错误。 “ERROR here(1)”中的错误是:
错误3错误C2871:'std':具有此名称的命名空间不存在 nisampleclient nisampleclientdefs.h 16
如果我删除using namespace std;
declaration并将ERROR HERE(2)更改为ѭ2,然后我收到错误:
错误3错误C2653:'std':不是类或命名空间名称 nisampleclient nisampleclientdefs.h 23
在那一点上。
提前致谢。 :)
没有找到相关结果
已邀请:
2 个回复
购藏盗码韦
标题(
,而不是string.h;))。 此外,不要使用:
...在标题中,除非你想要打倒你的开发者的愤怒;) 侧注:在C ++中,大多数传统的C标准接头都有对接部件,没有延伸
但带有前导
。在你的情况下,
将是更好的选择,虽然它取决于你使用的编译器是否存在实际差异。
甲车劲
类模板有三个参数。所以你要做到这一点: