LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 09-18-2004, 05:58 PM   #1
ashirazi
Member
 
Registered: Jul 2004
Posts: 60

Rep: Reputation: 15
cpp error


Hey,

I have a class called StateUtil and im trying to inherit this into Model class, but its not working. I get an error:

Model.h:10: base class `StateUtil' has incomplete type

Any idea?????

Thanks
raven

Code:
#ifndef STATEUTIL_H
#define STATEUTIL_H

class StateUtil;
#include "States.h"

class StateUtil {
        public:
                NullCalc *_state;
                StateUtil();
                void set_state(InitialState *iState);

};

#endif
Code:
class Model;
#include "States.h"
#include "Operators.h"
#include "CalculatorEngine.h"
#include "StateUtil.h"

class Model : public StateUtil{

        private:
 
Old 09-18-2004, 06:49 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
Remove forward declarations from these files. You should use forward declarations, above other classes, when your not including the header file, not in the header files for the actual classes, and then only if you actually refrence the class in the declaration of the other.

If that makes sense to you...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
desperate help, CPP ERROR ashirazi Programming 4 09-17-2004 04:36 AM
Chitin.cpp error abk4523 Linux - Games 0 09-12-2004 11:17 AM
debian dpkg cpp depends on cpp error darkleaf Linux - Software 2 06-25-2004 02:47 AM
CPP error, please help... TomAL Mandriva 3 12-24-2003 10:57 AM
cpp error ANU Linux - Software 1 12-06-2003 12:24 AM


All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration