原文解决方案

#include "string.h"
#include "stdafx.h"
#include "Chapter 01 MyVersion.h"
#include "cGameError.h
class cGameError
{
string m_errorText;
public:
cGameError( char *errorText )
{
DP1("***\n*** [ERROR] cGameError thrown! text: [%s]\n***\n",
errorText );
m_errorText = string( errorText );
} const char *GetText()
{
return m_errorText.c_str();
}
}; enum eResult
{
resAllGood = 0, // function passed with flying colors
resFalse = 1, // function worked and returns 'false'
resFailed = –1, // function failed miserably
resNotImpl = –2, // function has not been implemented
resForceDWord = 0x7FFFFFFF
};

解决方案:include <string> 替换 include "string.h"

在c++中,include "string.h" 是标准C的头文件

<string>是c++头文件,里面定义了string类;

你也可以通过使用指定命名空间的方式来使用string类:

std::string m_errorText;

或者通过使用

using namespace std;

在你文件上方的某个地方声明它;

最新文章

  1. scikit-learn 和pandas 基于windows单机机器学习环境的搭建
  2. 安装ubuntu系统
  3. CodeForces #369 C. Coloring Trees DP
  4. android + javascript 相互通信实例分析
  5. RTP、RTCP
  6. phpstorm 配置
  7. css学习笔记1
  8. web page diagnostics
  9. Spring+Hibernate+Struts(SSH)框架整合
  10. Dynamic Web Module 3.0 requires Java 1.6 or newer.的解决
  11. 第二部分之AOF持久化(第十一章)
  12. jquery.ajax()详解
  13. Visual Studio 2017的一些使用记录
  14. 关于nexus的学习
  15. SSM项目layui分页实例
  16. SharePoint 2013 Step by Step——How to Create a Lookup Column to Another Site(Cross Site)
  17. CTF-i春秋网鼎杯第一场misc部分writeup
  18. angular之interceptors拦截器
  19. MVC中@Html.Action的用法
  20. pow(x,y)函数的实现算法(递归函数)

热门文章

  1. vue中minxin---小记
  2. View Controller Programming Guide for iOS---(一)---About View Controllers
  3. 每天一水poj1502【最短路】
  4. bzoj 3160: 万径人踪灭【FFT+manacher】
  5. IT兄弟连 JavaWeb教程 使用Java同步机制对多线程同步
  6. postman接口测试系列:环境配置
  7. 构造 Bubble Cup 8 - Finals D. Tablecity
  8. git简单使用方法
  9. 自己写的MD5加密原码
  10. JAVA常用设计模式(静态化调用和实例化调用的区别,编辑可见 )