加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – tstring typedef问题

发布时间:2020-12-16 10:18:25 所属栏目:百科 来源:网络整理
导读:我有一个问题,试图自己键入一个非常方便的tstring(见下文) #ifndef _NISAMPLECLIENT_H_#define _NISAMPLECLIENT_H_#include windows.h#include stdlib.husing namespace std; // ERROR here (1)#ifdef _UNICODE#define CommandLineToArgv CommandLineToArgvW
我有一个问题,试图自己键入一个非常方便的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)”中的错误是:

Error 3 error C2871: ‘std’ : a namespace with this name does not exist nisampleclientnisampleclientdefs.h 16

如果我删除using namespace std;声明并将ERROR HERE(2)更改为typedef std :: basic_string< TCHAR> tstring;然后我收到一个错误:

Error 3 error C2653: ‘std’ : is not a class or namespace name nisampleclientnisampleclientdefs.h 23

在那一点上.

提前致谢.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读