expected class name-name before '{' token.

I think this error is somewhat infamous, yet searching around hasn't really revealed much to what I'm dealing with.

Total newbie to c++.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* 
 * File:   Stats.h
 * Author: holland
 *
 * Created on August 23, 2011, 5:13 PM
 */
#include "Character.h"

#ifndef STATS_H
#define	STATS_H

class Stats : public ClassOwner 
{//this is where the error reads off to. What am I doing wrong?
public:
    Stats(int id, Character owner) : ClassOwner(int )
    {}
    Stats(const Stats& orig);
    virtual ~Stats();
private:
    
};

[code]#include <iostream>

/* 
 * File:   Character.h
 * Author: holland
 *
 * Created on August 22, 2011, 7:09 PM
 */

#ifndef CHARACTER_H
#define	CHARACTER_H

enum Gender { MALE, FEMALE };

enum Race { DARK_ELF, HUMAN };

class Character
{
public:
    Character(std::string name, Gender gen, Race race);
    ~Character();
    
protected:
    

    
};



#endif	/* CHARACTER_H */ 



#endif /* STATS_H */[/code]
Have no idea what line number or file it is complaining about, so I have to guess.

I'd guess Stats.h line 12 since ClassOwner is not declared, though there is also a syntax error on line 15, and std::string is not declared before used in Character.h on line 42.
This may also be caused by a circular inclusion issue with your headers. I know this from previous experience...
Topic archived. No new replies allowed.