Thread: Class linker error

  1. #1
    Village id10t
    Join Date
    May 2008
    Posts
    57

    Class linker error

    I get these errors when trying to compile this class
    Code:
    class CDAccount
    {
    public:
    CDAccount(float Balance,float MatureBalance,float intrest,int term);//Constructor
    CDAccount(); //default constructor
    void input(istream& in);
    void output(ostream& out);
    
    private:
    float Balance;
    float MatureBalance;
    float intrest;
    int term;
    };

    [Linker error] undefined reference to `CDAccount::CDAccount(float, float, float, int)'

    [Linker error] undefined reference to `CDAccount::CDAccount()'

    [Linker error] undefined reference to `CDAccount:: output(std:: ostream&)'

    Please give me a clue as where i screwed this one up?

  2. #2
    Registered User
    Join Date
    Jan 2007
    Posts
    330
    you just declared the functions, you have to make em do something?

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    You didn't provide any implementation for the class functions, so the linker can't find any functions to call.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  3. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  4. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM