Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,277 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,182 people online right now. Registration is fast and FREE... Join Now!




C++ virtual method declaration

 
Reply to this topicStart new topic

C++ virtual method declaration

abosa53
post 14 Mar, 2008 - 12:21 PM
Post #1


New D.I.C Head

*
Joined: 14 Mar, 2008
Posts: 4

I'm having problems to compile following cpp header file. Any Ideas what I have done wrong?
I’m using Eclipse CDT with cygwin library.
Tanks for any help.

cpp

#ifndef _COMPONENT_H_
#define _COMPONENT_H_

#ifdef _WIN32
#pragma warning( disable: 4786)
#endif
#include <string>
using namespace std;
#include "appexc.hh"

class Component;
class AppDef;
class Chart;

class Component {
public:
/// Constructor.
Component();
/// Destructor.
virtual ~Component();
/// Setup the component.
virtual void Setup( AppDef& app) throw (AppException)=0 ;/* compile error on this line */
/// Run the component.
virtual void Run( Chart *chart) throw (AppException)=0 ;/* compile error on this line */
/// Returns #true# if the component needs to have a module loaded.
virtual bool NeedsModule();

string name;
};

#endif

*edit: Please use code tags in the future, thanks! code.gif

CDT Error messages :
overriding `virtual void Component::Run(Chart*) throw (AppException)' component.hh line 32
overriding `virtual void Component::Setup(AppDef&) throw (AppException)' component.hh line 30

This post has been edited by Martyr2: 14 Mar, 2008 - 12:32 PM
User is offlineProfile CardPM

Go to the top of the page

rizwans
post 14 Mar, 2008 - 03:31 PM
Post #2


New D.I.C Head

*
Joined: 26 Oct, 2005
Posts: 25


My Contributions


i'm not too sure about this but i noticed that you have an extra h in #include "appexc.hh"
Lose the h.
User is offlineProfile CardPM

Go to the top of the page

abosa53
post 15 Mar, 2008 - 08:51 AM
Post #3


New D.I.C Head

*
Joined: 14 Mar, 2008
Posts: 4

QUOTE(rizwans @ 14 Mar, 2008 - 04:31 PM) *

i'm not too sure about this but i noticed that you have an extra h in #include "appexc.hh"
Lose the h.


No the include statement is correct, the appexe.hh is c++ h file *.hh is valid h file.
br
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/22/08 12:37AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month