C++编译代码的时候提示‘getInstance’ is not a member of ‘A’ A& a = A::getInstance();解决办法
2017-03-21 10:52
615 查看
今天搞C++类模板的时候,写个实例,发现提示下面的错误
‘getInstance’ is not a member of ‘A’
A& a = A::getInstance();
代码:
解决办法:
是我自己写错了,把调用一个函数写错了,应该是A::Getinstance()不是A::getinstance(),希望下次不要犯这样的错误,切记,其实从英文错误我么也可以理解
XXX is not a member of A,说明XXX不是A里面的一成员函数,这就要检查自己是否写错了,要这样分析问题。
‘getInstance’ is not a member of ‘A’
A& a = A::getInstance();
代码:
class A { public: static T& Getinstance() { // } }; //调用的时候写成了 A::getinstance();
解决办法:
是我自己写错了,把调用一个函数写错了,应该是A::Getinstance()不是A::getinstance(),希望下次不要犯这样的错误,切记,其实从英文错误我么也可以理解
XXX is not a member of A,说明XXX不是A里面的一成员函数,这就要检查自己是否写错了,要这样分析问题。
相关文章推荐
- C++出现to_string is not a member of std 或者 to_string was not declared in this scope的解决方法
- python2.7web代码用python3.6运行时,浏览器发送请求报错TypeError: Object of type 'bytes' is not JSON serializable的解决办法
- IDEA编译时候出现问题:代码不提示错误,编译时出错解决办法
- sbt编译spark程序提示value toDF is not a member of Seq()
- linux下编译c++程序遇到 error: ‘thread’ is not a member of ‘std’的错误
- Dev-C++ “to_string is not a member of std” error- 已解决
- c++ 编译错误is not a static member of ...
- vs2015中编写C语言代码出现错误:提示scanf is not safe 问题解决办法
- Android NDK编译C++ 'stoi' and 'to_string' is not a member of 'std'
- 在编译的时候会提示 File not found:'*.dcu'解决办法
- Android打包提示xxx is not translated in yyy问题解决办法
- Fedora提示 xxxis not in the sudoers file.this incident will be reported解决办法
- svn:is not under version control and is not part of the commit, yet its child解决办法
- MPI编译C++程序出现#error "SEEK_SET is #defined but must not be for the C++ binding of MPI" 的解决方法
- Qt 解决“is not a member of ‘std’”错误
- 编译错误“The run destination My Mac 64-bit is not valid for Running the scheme '***',解决办法
- 编译php的时候,报configure: error: mcrypt.h not found. Please reinstall libmcrypt.错误的解决办法
- 打开sln文件出现 “the selected file is not a valid visual studio solution file”错误提示解决办法
- 【VC】编译出错is not a class or namespace name的解决办法
- The application is not licensed to modify or create schema for this type of data 解决办法