我在尝试为自己键入一个方便的 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;
声明并将 ERROR HERE (2) 更改为说,typedef std::basic_string<TCHAR> tstring;
那么我会收到一个错误:
错误 3 错误 C2653: 'std' : 不是类或命名空间名称 \nisampleclient\nisampleclientdefs.h 23
那时相反。
提前致谢。:)