wilsonian
asked on
Error 2629: unexpected 'class ClassA ('
Hi there,
Sorry if I explain this badly, I'm not quite sure what is relevant.
I'm getting the error above when I try to compile my project. The line in question is in ClassA.h and looks something like:
ClassA(ClassB* theParent, type theType);
where type is a typedef inside classA and ClassB is #included above the constructor.
There's another error on the same line:
Error C2238: unexpected token(s) preceding ';'
The error seems to come up while compiling a third class which does not refer to ClassB or ClassA or refer to anything that does.
The problem arose when I moved the typedef from another unrelated class and put it in ClassA. This typedef is used as a parameter and return type for several functions both inside and outside ClassA (but not in ClassB or either of the other two classes I mentioned)
What's going on? I'm very confused.
Thank you.
Sorry if I explain this badly, I'm not quite sure what is relevant.
I'm getting the error above when I try to compile my project. The line in question is in ClassA.h and looks something like:
ClassA(ClassB* theParent, type theType);
where type is a typedef inside classA and ClassB is #included above the constructor.
There's another error on the same line:
Error C2238: unexpected token(s) preceding ';'
The error seems to come up while compiling a third class which does not refer to ClassB or ClassA or refer to anything that does.
The problem arose when I moved the typedef from another unrelated class and put it in ClassA. This typedef is used as a parameter and return type for several functions both inside and outside ClassA (but not in ClassB or either of the other two classes I mentioned)
What's going on? I'm very confused.
Thank you.
Could you post your "related" code?
ASKER
What do you want, ClassA.h?
if that's where the error is...
ASKER
// LengthBar.h: interface for the LengthBar class.
//
////////////////////////// ////////// ////////// ////////// ////////// ////
#if !defined(AFX_LENGTHBAR_H__ F59F85DC_D 3DA_4185_A 61F_131854 05C7D6__IN CLUDED_)
#define AFX_LENGTHBAR_H__F59F85DC_ D3DA_4185_ A61F_13185 405C7D6__I NCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Phoneme.h"
#include "EyeSpeakPage.h"
class LengthBar
{
public:
typedef enum unmatched_type {
VOWEL_LENGTH,
VOICING,
L_R_NESS,
P_F_NESS,
S_SH_NESS,
SH_CH_NESS,
H_F_NESS,
B_V_NESS,
V_W_NESS,
J_Y_NESS,
WB_H_NESS,
S_TH_NESS,
F_TH_NESS,
T_TH_NESS,
D_THV_NESS,
Z_THV_NESS,
M_N_NESS,
N_NG_NESS,
NGK_NG_NESS,
N_L_NESS
} unmatched_type;
LengthBar(EyeSpeakPage* theParent, unmatched_type thePurpose); //ln 44*****
void drawArrow(CDC* dc, int length, int tooLong);
unmatched_type getPurpose();
void setRightEnd(CString end);
CString getRightEnd();
void setLeftEnd(CString end);
CString getLeftEnd();
int TooLong(int length);
int ShowLength(CDC *dc, Phoneme* contrast, CString speaker, bool isUser, int placeInPair);
void Draw(CDC* dc, Phoneme::length length); //isLong == unvoiced
virtual ~LengthBar();
private:
unmatched_type purpose;
CString rightEnd;
CString leftEnd;
double getRatioX();
double getRatioY();
EyeSpeakPage* parent; //ln 64************************ ********** ***
Phoneme::length barLength;
int LEFT_EDGE;
};
#endif // !defined(AFX_LENGTHBAR_H__ F59F85DC_D 3DA_4185_A 61F_131854 05C7D6__IN CLUDED_)
I get the following errors when compiling Phoneme.cpp, as well as about a dozen other files not mentioned here:
c:\vpsl\product\c++\eyespe ak\gui\len gthbar.h(4 4) : error C2629: unexpected 'class LengthBar ('
c:\vpsl\product\c++\eyespe ak\gui\len gthbar.h(4 4) : error C2238: unexpected token(s) preceding ';'
c:\vpsl\product\c++\eyespe ak\gui\len gthbar.h(6 4) : error C2143: syntax error : missing ';' before '*'
c:\vpsl\product\c++\eyespe ak\gui\len gthbar.h(6 4) : error C2501: 'EyeSpeakPage' : missing storage-class or type specifiers
c:\vpsl\product\c++\eyespe ak\gui\len gthbar.h(6 4) : error C2501: 'parent' : missing storage-class or type specifiers
//
//////////////////////////
#if !defined(AFX_LENGTHBAR_H__
#define AFX_LENGTHBAR_H__F59F85DC_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Phoneme.h"
#include "EyeSpeakPage.h"
class LengthBar
{
public:
typedef enum unmatched_type {
VOWEL_LENGTH,
VOICING,
L_R_NESS,
P_F_NESS,
S_SH_NESS,
SH_CH_NESS,
H_F_NESS,
B_V_NESS,
V_W_NESS,
J_Y_NESS,
WB_H_NESS,
S_TH_NESS,
F_TH_NESS,
T_TH_NESS,
D_THV_NESS,
Z_THV_NESS,
M_N_NESS,
N_NG_NESS,
NGK_NG_NESS,
N_L_NESS
} unmatched_type;
LengthBar(EyeSpeakPage* theParent, unmatched_type thePurpose); //ln 44*****
void drawArrow(CDC* dc, int length, int tooLong);
unmatched_type getPurpose();
void setRightEnd(CString end);
CString getRightEnd();
void setLeftEnd(CString end);
CString getLeftEnd();
int TooLong(int length);
int ShowLength(CDC *dc, Phoneme* contrast, CString speaker, bool isUser, int placeInPair);
void Draw(CDC* dc, Phoneme::length length); //isLong == unvoiced
virtual ~LengthBar();
private:
unmatched_type purpose;
CString rightEnd;
CString leftEnd;
double getRatioX();
double getRatioY();
EyeSpeakPage* parent; //ln 64************************
Phoneme::length barLength;
int LEFT_EDGE;
};
#endif // !defined(AFX_LENGTHBAR_H__
I get the following errors when compiling Phoneme.cpp, as well as about a dozen other files not mentioned here:
c:\vpsl\product\c++\eyespe
c:\vpsl\product\c++\eyespe
c:\vpsl\product\c++\eyespe
c:\vpsl\product\c++\eyespe
c:\vpsl\product\c++\eyespe
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Well, I wasn't declaring class EyeSpeakPage at all.
But doing so seems to have fixed all the errors. I'd swear I'd tried that on Friday, oh well.
Thank you very much, I think that was close enough to being the answer!
But doing so seems to have fixed all the errors. I'd swear I'd tried that on Friday, oh well.
Thank you very much, I think that was close enough to being the answer!