내 C++ 파일을 컴파일하는 데 문제가 있습니다. 이 오류가 내가 얻을 수 있습니다 :암시 적으로 선언 된 함수 오류 C++
여러 마커를이 줄 에서 - 회원 선언 를 찾을 수 없습니다 - 암시 적 선언 'InsultGenerator :: InsultGenerator (const를 InsultGenerator &)'내가는 MinGW을 사용하고
을 정의 내 컴파일러로.
다음#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "Insultgenerator_0hl14.h"
using namespace std;
FileException::FileException(const string& m) : message(m){}
string& FileException::what(){ return message;}
NumInsultsOutOfBounds::NumInsultsOutOfBounds(const string& m) : message(m){}
string& NumInsultsOutOfBounds::what(){ return message;}
InsultGenerator::InsultGenerator(const InsultGenerator&) {}
void InsultGenerator::initialize() const{
int cols(0);
string x;
string filename("InsultsSource.txt");
ifstream file(filename.c_str());
if(file.fail()){
throw FileException("File not read.");
}
while(file >> x){
}}
//vector<string> InsultGenerator::talkToMe() const{
// };//end talkToMe
// vector<string> InsultGenerator::generate(const int n) const{
// };//end generate
//int InsultGenerator::generateAndSave(const string filename, const int n) const{
//};//end generateAndSave
헤더 파일입니다 :
#ifndef INSULTGENERATOR_0HL14_H_
#define INSULTGENERATOR_0HL14_H_
#include <string>
#include <vector>
using namespace std;
class InsultGenerator{
public:
InsultGenerator(vector<string>);
void initialize() const;
string talkToMe() const;
vector<string> generate(const int) const;
int generateAndSave (const string, const int) const;
private:
vector<string> colA;
vector<string> colB;
vector<string> colC;
};
class FileException{
public:
FileException(const string&);
string& what();
private:
string message;
};
class NumInsultsOutOfBounds{
public:
NumInsultsOutOfBounds(const string &);
string& what();
private:
string message;
};
#endif
당신이 전체 오류 텍스트를 제공 할 수 있을까요? 회원 선언을 찾을 수 없습니다 \t - - – horns
여기가 \t이 줄에 여러 개의 마커 당신이 오류를보고하기 전에 당신이 만든 마지막 변경이 무엇인지 암시 적 선언 'InsultGenerator :: InsultGenerator (const를 InsultGenerator &)' –
의 정의? 이것이 [오류를 생성하는 가장 간단한 코드인가?] (http://stackoverflow.com/help/mcve)? – Beta