I know the common answer for this question, but for some reason I get the error when using the right syntax, on Code::Blocks, I'll post a sample to show I'm not bluffing:
class BulletPlacer : sf::Drawable
{
public:
BulletPlacer();
BulletPlacer(const unsigned Quantity);
~BulletPlacer();
};
That was a small portion of the hpp file.
BulletPlacer::BulletPlacer()
:Amount(0), Min(0)
{}
BulletPlacer::BulletPlacer(const unsigned Quantity)
:Amount(Quantity), Min(0)
{
Bullet shot;
ShotVec.reserve(Amount);
for(unsigned i = 0; i < Amount; ++i)
{ ShotVec.push_back(shot); }
}
BulletPlacer::~BulletPlacer() { PolVecV.clear(); ShotVec.clear(); }
And that was the cpp. It compiled fine until I began refactoring the class and I get the error with all the methods. I also get other errors that have no place at all and I get them with all the functions in the class. I even redownloaded a GCC version only to find that it gives me the exact same result.
Here's the simplified version of the error log:
error: extra qualification 'BulletPlacer::' on member 'BulletPlacer' [-fpermissive]|
error: 'BulletPlacer::BulletPlacer()' cannot be overloaded|
error: with 'BulletPlacer::BulletPlacer()'|
And it gets repeated like this with all functions. It's very annoying since I can't advance at all with my SFML game just because of this and checking a 300 lines file for possible errors just because the compiler is mad at me is no fun at all. And no, none of the files that gets used by "BulletPlacer" gets this.
And it gets worse, a totally unrelated class gets something similar as well:
error: cannot define member function 'BulletPlacer::Enemy::Enemy' within 'BulletPlacer'
When the class doesn't even include the file...
I'm using GCC 4.7.1
Thanks in advance for any help I may get.
The errors imply that the compiler thinks those definitions are found lexically within the class definition, which implies a missing }; or somesuch.
That's all I can say from the information provided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With