469,953 Members | 1,959 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,953 developers. It's quick & easy.

"missing storage-class..." and "missing ';'... "

I'm following code out of a howto book and this is really bugging me. This header file was created by VStudio 6.0 when I did a "Right Click: Add Member Function" CLine is a class I wrote (per the book's instructions) and Line.h in included in Day10Doc.cpp

Here is the contents of Day10Doc.h
Expand|Select|Wrap|Line Numbers
  1. #if !defined(AFX_DAY10DOC_H__16736853_CB29_49E7_A8ED_C912CAE666EC__INCLUDED_)
  2. #define AFX_DAY10DOC_H__16736853_CB29_49E7_A8ED_C912CAE666EC__INCLUDED_
  3.  
  4. #if _MSC_VER > 1000
  5. #pragma once
  6. #endif // _MSC_VER > 1000
  7.  
  8.  
  9. class CDay10Doc : public CDocument
  10. {
  11. protected: // create from serialization only
  12.     CDay10Doc();
  13.     DECLARE_DYNCREATE(CDay10Doc)
  14.  
  15. // Attributes
  16. public:
  17.  
  18. // Operations
  19. public:
  20.  
  21. // Overrides
  22.     // ClassWizard generated virtual function overrides
  23.     //{{AFX_VIRTUAL(CDay10Doc)
  24.     public:
  25.     virtual BOOL OnNewDocument();
  26.     virtual void Serialize(CArchive& ar);
  27.     //}}AFX_VIRTUAL
  28.  
  29. // Implementation
  30. public:
  31.     CLine* GetLine(int nIndex); //LINE 36
  32.     int GetLineCount();
  33.     CLine* AddLine(CPoint ptFrom, CPoint ptTo);  //LINE 38
  34.     virtual ~CDay10Doc();
  35. #ifdef _DEBUG
  36.     virtual void AssertValid() const;
  37.     virtual void Dump(CDumpContext& dc) const;
  38. #endif
  39.  
  40. protected:
  41.  
  42. // Generated message map functions
  43. protected:
  44.     //{{AFX_MSG(CDay10Doc)
  45.         // NOTE - the ClassWizard will add and remove member functions here.
  46.         //    DO NOT EDIT what you see in these blocks of generated code !
  47.     //}}AFX_MSG
  48.     DECLARE_MESSAGE_MAP()
  49. private:
  50.     CObArray m_oaLines;
  51. };
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54.  
  55. //{{AFX_INSERT_LOCATION}}
  56. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  57.  
  58. #endif // !defined(AFX_DAY10DOC_H__16736853_CB29_49E7_A8ED_C912CAE666EC__INCLUDED_)
day10doc.h(36) : error C2143: syntax error : missing ';' before '*'
day10doc.h(36) : error C2501: 'CLine' : missing storage-class or type specifiers
day10doc.h(36) : error C2501: 'GetLine' : missing storage-class or type specifiers
day10doc.h(38) : error C2143: syntax error : missing ';' before '*'
day10doc.h(38) : error C2501: 'CLine' : missing storage-class or type specifiers
day10doc.h(38) : error C2501: 'AddLine' : missing storage-class or type specifiers

I can't find any obvious syntax error, and I have no idea what the storage class line means...
Jan 17 '07 #1
1 3901
Banfa
9,065 Expert Mod 8TB
Is Line.h included into Day10Doc.cpp before or after Day10Doc.h.

It needs to be included before Day10Doc.h because Day10Doc.h makes use of it's contents.
Jan 22 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

43 posts views Thread by steve | last post: by
2 posts views Thread by steve | last post: by
8 posts views Thread by TTroy | last post: by
5 posts views Thread by martin | last post: by
8 posts views Thread by Ulysse | last post: by
2 posts views Thread by Angus | last post: by
5 posts views Thread by Maria Sudderman | last post: by
1 post views Thread by manchin2 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.