Collect2:错误参考方法,未定义

时间:2019-03-29 11:18:58

标签: c++14

我正在构建一个基本程序来制作一个包含c ++中的对象的列表,我已经看过几次代码了,只是被卡住了,我的教授没有回答,所以如果有的话,必须尽快提交任何人都可以帮助我找到为什么说select N1.*,case when N1.[end]+1=N2.[start] then 1 else 2 end Result from @NumberRange N1 inner join @NumberRange N2 on N1.Id=N2.Id-1 没有明确定义的原因。我正在编译所有文件,并且#include也包含在所有文件中。

我尝试了不同的方法来访问该方法,但是每次它都会抛出错误。至少我现在有代码,没有任何错误。

getTotal2020()

错误是给我的是:

class Data {

    public:
    Data(string neighborhood, int total2020, int numOfMen, int numOfWomen);
    string neighborhood;
    int total2020;
    int numOfMen;
    int numOfWomen;
    ~Data();
    string getNeighborhood();
    int getTotal2020();
    int getNumOfMen();
    int getNumOfWomen();
};

Data::Data(string neighborhood, int total2020, int numOfMen, int numOfWomen) {
    this->neighborhood;
    this->total2020;
    this->numOfMen;
    this->numOfWomen;
}

string getNeighborhood(string neighborhood){
    return neighborhood;
}

int getTotal2020(int total2020){
    return total2020;

}

int getNumMen(int numOfMen){
    return numOfMen;
}

int getNumOfWomen(int numOfWomen){
    return numOfWomen;
}

class Node{
    public:
    Node* next;
    Data* data;

    Node(Node* next, Data* data){
        this->next = next;
        this->data = data;
    }
    Node* getNode(){
        return next;
    }
    Data* getData(){
        return data;
    }
};

void List::findElement(int findMinPop){
    Node* aux;
    aux = head;
    while(aux){
      if(aux->getData()->getTotal2020() >= findMinPop){
        cout << "The population is greater" << endl;
      } else {
        cout << "The populations is less than you were looking for" << endl;
      }

      aux = aux->next;
    }
}

0 个答案:

没有答案