Thread: errors with virtual functions

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    39
    Quote Originally Posted by rogster001 View Post
    what compiler are you using? i would have expected a different error so perhaps something else is going on that you have not posted, but in any case if you declare a virtual function then you also have to provide an implementation, so just place a pair of curly braces after the declaration in your class definition
    I am using the Dev C++. I have also provided the virtual functions implementations along with the child class definitions. I just removed them, when posting the code.

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    I'm not sure what the problem is but MinGW GCC 4.5 can compile your code as is. To get the same amazing result, you could just upgrade your compiler (which means throwing Dev-C++ away probably) and try this orthis .

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. virtual functions
    By lord in forum C++ Programming
    Replies: 9
    Last Post: 10-18-2008, 02:55 PM
  2. Replies: 48
    Last Post: 09-26-2008, 03:45 AM
  3. i need a good example of virtual functions
    By Anddos in forum C++ Programming
    Replies: 10
    Last Post: 02-15-2006, 11:48 AM
  4. Replies: 2
    Last Post: 10-02-2005, 05:04 PM
  5. Exporting Object Hierarchies from a DLL
    By andy668 in forum C++ Programming
    Replies: 0
    Last Post: 10-20-2001, 01:26 PM