I'm following a tutorial to build a particle explosion project. I'm working in steps and creating a new project for each step. In order to get practice typing out the code, for each new project, I retype the code from the previous project before adding the new step.
When I type out the code in the new project, I get error messages and the project will not build and run. It's exactly the same code as the previous project that builds and runs just fine! I've double checked and triple checked to make sure that I didn't make a mistake in typing.
The project has 3 classes: Screen, Particles and Swarm. In this step, I've retyped the code that makes the particles move. *Again, the previous project is running perfectly:
In Swarm.h :
1 2 3 4 5 6 7 8 9 10
|
class Swarm {
public:
const static int NPARTICLES = 3000;
private:
Particles * m_pParticles;
public:
Swarm ( );
void update ( );
const Particles * const getParticles ( ) { return m_pParticles; };
};
|
The error is "Particles" does not name a type at lines 5 and 9.
In the main.cpp file, I get the related error "class Swarm" has no member named getParticles.
I have tried cleaning the build, changing the Build Configuration from "Use Active" to "Select Automatically" (this step fixed the problem in the previous step). I tried shutting down and restarting.
I don't know what else to try.
I'm using Eclipse IDE 2020-06 (4.16.0) with MinGW-64 and SDL2 on a Windows 10 laptop.