Thread: Can't figure it out the error??? HELP!!!

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    6

    Unhappy Can't figure it out the error??? HELP!!!

    I have this code:
    Code:
    #include<iostream>
    #include<fstream>
    using namespace std;
    
    ifstream fin("date.txt");
    
    class BankLoanApproval{
    	int records;
    	double yr_income;
    	double loan_amount;
    	int term_of_loan;
    	int cust_status;
    public:
    	
    	BankLoanApproval (int r, double y, double la, int t, int cs); 
    	int GetRecords() {return records;}
    	double GetIncome() {return yr_income;}
    	double GetLoanAmount() {return loan_amount;}
    	int GetTerm() {return term_of_loan;}
    	int GetStatus() {return cust_status;}
    	void SetRecords(int n_records)
    	{
    		records=n_records;
    	}
    	void SetIncome(double new_income)
    	{
    		yr_income=new_income;
    	}
    	void SetLoan(double new_amount)
    	{
    		loan_amount=new_amount;
    	}
    	void SetTerm(int term)
    	{
    		term_of_loan=term;
    	}
    	void SetStatus(int c_status)
    	{
    		cust_status=c_status;
    	}
    };
    
    
    
    void main()
    {
    	if (!fin)
    	{
    		cout << " Can not Open the input file with customer data!!"<< endl;
    		exit(1);
    	}
    
    	int rec;
    	double income;
    	double amount;
    	int term;
    	int status;
    	fin >> rec >> income >> amount >> term >> status;
    	BankLoanApproval loan(rec, income, amount, term, status);
    	loan.SetRecords(rec);
    	cout << loan.GetRecords();
    
    }
    This compile perfectly but when I want to run it I get the following error, can anyone help me I can not figure it out what it is cousing the problem or error, thanks.

    Code:
    Linking...
    BankLoan.obj : error LNK2001: unresolved external symbol "public: __thiscall BankLoanApproval::BankLoanApproval(int,double,double,int,int)" (??0BankLoanApproval@@QAE@HNNHH@Z)
    Debug/assigment2.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.
    
    assigment2.exe - 2 error(s), 0 warning(s)
    &#91;code]&#91;/code]tagged by Salem

  2. #2
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361

  3. #3
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Change
    BankLoanApproval (int r, double y, double la, int t, int cs);
    to
    BankLoanApproval (int r, double y, double la, int t, int cs) {};
    and I suggest you remove the argument list if you're not going to do anything with the variables passed. That, or you could assign the arguments to your member variables.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 3 dimensional figure volume
    By thekautz in forum C++ Programming
    Replies: 2
    Last Post: 01-20-2009, 05:22 PM
  2. trying to figure out someone's code for a plugin
    By paulpars in forum C++ Programming
    Replies: 4
    Last Post: 07-20-2006, 10:57 AM
  3. newb to C, cant figure something out.
    By Phate4219 in forum C Programming
    Replies: 16
    Last Post: 03-06-2006, 01:47 AM
  4. ahh i can't figure out this loop
    By blindleaf in forum C Programming
    Replies: 1
    Last Post: 03-18-2003, 09:42 AM
  5. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM