I have a class Text:
1 2 3 4 5 6
|
//text.h
class Text
{
public:
write_blended(/*something*/) {/*function definition*/ }
};
|
and a class Game:
1 2 3 4 5 6 7 8
|
//game.h
#include "text.h"
class Game
{
public:
Text text;
Game();
}
|
1 2 3 4 5 6
|
//game.cpp
#include "game.h"
Game::Game()
{
text.write_blended(/*something*/);
}
|
After writing all this I add a function size() to Text and change Game::Game() to:
1 2 3 4 5
|
Game::Game()
{
text.write_blended(/*something*/)
text.size();
}
|
I get an error 'class Text' has no member named 'size'. I've tried rebuilding the code from scratch but to no avail.
Any ideas?
Last edited on
Uh... What?
The only method in Text is write_blended(). The compiler can't call a function you haven't defined.
Okay, so you defined it, but did you declare it in the header?
Yup, it was an IDE problem. Fixed.