Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » "Particles" does not name a type Error(Baffling Errors with Particle Explosion Project _ Beginner C++)
"Particles" does not name a type Error [message #1830045] Thu, 16 July 2020 09:33 Go to next message
Connie Fischer is currently offline Connie FischerFriend
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

Re: "Particles" does not name a type Error [message #1830063 is a reply to message #1830045] Thu, 16 July 2020 14:56 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
This forum is not about programming .
Your question is off-topic.

That said, you are getting it because Particles wasn't defined.
Define it and the error will go away.
You also need code for Swarm::Swarm and Swam::update.
Without them you will get link errors.




Re: "Particles" does not name a type Error [message #1830064 is a reply to message #1830063] Thu, 16 July 2020 15:03 Go to previous messageGo to next message
Connie Fischer is currently offline Connie FischerFriend
Messages: 10
Registered: April 2020
Junior Member
I am sorry. I thought this forum was for issues with Eclipse IDE C/C++.

I do not think that my problem is a "programming" problem. It can't be. The codes in the two projects are the same.
Re: "Particles" does not name a type Error [message #1830066 is a reply to message #1830064] Thu, 16 July 2020 15:32 Go to previous message
Connie Fischer is currently offline Connie FischerFriend
Messages: 10
Registered: April 2020
Junior Member
Apologies! David, you were right. Even though I checked and double checked, I still missed two lines of code in the Swarm.cpp file.

And that does make this a programming issue and again, I apologize.
Previous Topic:Indexer not finding the right files, despite include directories specified
Next Topic:Editor tabs completely blank when I try to open sources files :(
Goto Forum:
  


Current Time: Fri Apr 19 11:07:21 GMT 2024

Powered by FUDForum. Page generated in 0.02582 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top