|
-
April 21st, 2002, 02:27 AM
#3
Re: How come I get compiler errors when using the STL inside a class?
You must have forgotten to #include <list> somewhere. Your solution to your previous problem is not the best -- you should have done this:
#include <list>
#include "Button.h" //my Button class header
class Screen
{
public:
//Stuff Cut Out
private:
std::list<Button*> pButtonList;
//More stuff cut
};
Note the use of std:: instead of the "using" clause. When you use "using", you are introducing a namespace into your header file. Reserve the "using" clause for .CPP files, not headers.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|