Class linker error

This is a discussion on Class linker error within the C++ Programming forums, part of the General Programming Boards category; I get these errors when trying to compile this class Code: class CDAccount { public: CDAccount(float Balance,float MatureBalance,float intrest,int term);//Constructor ...

  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をこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,167
    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.
    For information on how to enable C++11 on your compiler, look here.
    よく聞くがいい!私は天才だからね! ^_^

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, 02: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, 02: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, 12:10 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21