So I have a file, ParticleList.h, that is a class declaration for a linked list. A few other files declare and use this linked list in them. So I have #include "ParticleList.h" at the top of my main program. But if I don't have it in a function that the main program calls that also uses it, it says that ParticleList wasn't declared in that scope. But if I DO include it at the top of the called function, it whines about redeclaring ParticleList.
So what's the solution? Should I make it a .cpp instead and have it be explicitly called by my makefile?
Alternatively, you could be redeclaring your class inside the header file, or you could be #including a header file where ParticleList is already defined.