簡體   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