繁体   English   中英

编译器错误:未命名类型

[英]Compiler error: does not name a type

我是C ++的新手,通常可以找出错误并找出问题所在,但是我很困惑。

我收到一条错误消息,说“ line | 10 | error:类'mine'中的'string'没有命名类型”

这是mine.h:

#ifndef MINE_H
#define MINE_H
#include <iostream>
#include <string>

using namespace std;

class mine
{

public:
mine();
string getName();

};

#endif // MINE_H

这是mine.cpp:

#include "mine.h"
#include <iostream>
#include <string>

using namespace std;
mine::mine()
{
    //ctor
}

mine::string getName()
{

}
mine::string getName()
{

} 

本来应该

string mine::getName()
{

} 

它应该是:

string mine::getName()
{

}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM