I have googled this to quite a bit...and I'm just not understanding the problem. I have header guards...I tried forward declarations...(which I don't fully understand yet, but that doesn't FEEL like the anwser..maybe I'm wrong. I've put a great deal of hours into this...any assistance or suggestion greatly appreciated. Thanks.
Here is my Sound.h.
I continue to get the error "Type expected class-name before ‘{’ token" right where I'm trying to use Element as a base class...
Just some observations.
1. You own project files should not be included with <>
2. Element is an abstract base class, but doesn't have a virtual destructor.
#ifndef SOUND_H_
#define SOUND_H_
#include "fruitpunch/Elements/Element.h"
#include <boost/shared_ptr.hpp>
#include <vector>
#include "string"
namespace fpunch {
class Sound : public Element {
public:
Sound();
Sound(std::string);
void play();
void stop();
virtualvoid renderFrame();
virtual ~Sound();
private:
boost::shared_ptr<std::vector<char> > mData;
int mFreq;
int mChannels;
int mInstanceId;
bool mIsPlaying;
bool mIsLoop;
}; // end class Sound
} // end namespace fpunch
#endif /*SOUND_H_ */
I'm wondering why it can't see see the definition of Element... This other class can see Element just fine...I will make a note that my project files should not be in <> thank you.
The playable class works well extending from Element...which is why I keep thinking I've done something wrong in the Sound class somewhere...Of course I could be mistaken...
Anyway the problem ended up being that I messed a few of the other like 8 classes that I added. A tricky circular include was one problem. The problems in the other classes caused an issue with this class to not compile correctly.