"Particles" does not name a type Error [message #1830045] |
Thu, 16 July 2020 09:33 |
Connie Fischer Messages: 10 Registered: April 2020 |
Junior Member |
|
|
I edited the post because think I made my question too long and complicated. In a nutshell, I created Project A to animate particles. It builds and runs perfectly.
Then I copied (retyped) the code from A to create Project B. So, Project B is a copy of Project A. Project B will not build.
class Swarm {
public:
const static int NPARTICLES = 3000;
private:
Particles * m_pParticles;
public:
Swarm ( );
void update ( );
const Particles * const getParticles ( ) { return m_pParticles; };
};
This is the part of the code that shows the error. This is the Swarm header file.
The error is with Particles * m_pParticles and the const getParticles line. The error says that "Particles" does not name a type.
There is an additional error in the main.cpp file that says "Swarm class does not have member 'getParticles'."
Here is the code (copied and pasted) from Project A:
[class Swarm {
public:
const static int NPARTICLES = 4000;
private:
Particle * m_pParticles;
public:
Swarm();
void update ();
const Particle * const getParticles () { return m_pParticles; };
};
Does anyone have an idea of why this is happening? It has happened before.
I'm using Eclipse IDE 2020-06 (4.16.0) with MinGW-64 and SDL2 on a Windows 10 laptop.
[Updated on: Thu, 16 July 2020 14:59] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02582 seconds