Not sure what I'm doing wrong, was hoping someone can point me in the right direction. I created a customer class but I cannot initialize it.
customer.h
#ifndef CUSTOMER_H
#define CUSTOMER_H
#include "defs.h"
#include <string>
using namespace std;
class Customer
{
public:
Customer(string fName, string lName);
string getFirstName();
string getLastName();
int getCustID();
int getNumAccounts();
protected:
string firstName;
string lastName;
int custID;
int numAccounts;
};
#endif
customer.cc
#include "defs.h"
#include "Customer.h"
int Customer::nextCustID = 9001;
void Customer(){
//nothing;
}
void Customer::Customer(int test, int tes2)
{
custID = 100;
firstName = "George";
lastName = "sadfsad";
numAccounts = 0;
}
void Customer::Customer(string fName, string lName)
{
custID = nextCustID++;
string firstName = fName;
string lastName = lName;
numAccounts = 0;
}
int Customer::getCustID() { return custID; }
string Customer::getFirstName() { return firstName; }
string Customer::getLastName() { return lastName; }
int Customer::getNumAccounts() { return custID; }
I am trying to initialize the customer with
Customer test("Billy", "Bob");
But then I get the error when I try to initialize
BankControl.cc:(.text+0xaf): undefined reference to `Customer::Customer(std::string, std::string)'
collect2: error: ld returned 1 exit status
I can't figure out what I'm doing wrong, if anyone has some input, that would be great. Thanks a lot in advance.
Bankcontrol.cc
#include "BankControl.h"
#include "Account.h"
#include "Customer.h"
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include "View.h"
BankControl::BankControl()
{
Customer test("Joe", "Billy");
}