home *** CD-ROM | disk | FTP | other *** search
- Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
- Path: sparky!uunet!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!sm86+
- Newsgroups: comp.lang.c++
- Message-ID: <seckQ7200awJAJJJ0i@andrew.cmu.edu>
- Date: Tue, 1 Sep 1992 02:00:39 -0400
- From: Stefan Monnier <sm86+@andrew.cmu.edu>
- Subject: Overloading (method redefining)
- Lines: 47
-
-
- Although I'm already used to OOP, I'm new to C++
-
- Whiel experimenting with a silly example, I have a little problem when
- I want to redefine a method in a subclass:
-
- class bidon1 {
- public:
- void Fonction();
- };
-
- void bidon1::Fonction()
- {
- // do something not too silly
- };
-
- class bidon2: public bidon1 {
- int a,b;
- public:
- void Fonction();
- };
-
- void bidon2::Fonction()
- {
- printf(...,a,b);
- };
-
-
- The loader always teels me: Fonction__8bidon1: multiply defined
-
- I tried to put a 'virtual' in front of void in bidon1,
- I tried to put a '-fall-virtual' on the command line (I use G++)
- Always the same result!
-
- What do I need (well, maybe I just need a book) ?
-
- Stefan Monnier
-
-
- -----------------------------------------------------
- -- On the average, people seem to be acting normal --
- -----------------------------------------------------
-
-
-
-
-
-