Jump to content
  • Advertisement
Sign in to follow this  
ShmeeBegek

Another problem with mingw

This topic is 4777 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have another problem now..
cStringTree *getNode(list<Character*>strings,int nless=0)
	{
		// Traverse down the tree
		cStringTree<Character,Type> *cnode = this;
		int l = strings.size();
		list<Character*>::iterator it;


On the last line there where I declare the iterator I get: error: expected ';' before "it" Just out of interest I changed Character to char and it worked perfectly... but there shouldn't be a reason for Character causing compilation errors:
template <class Character,class Type>


Any ideas on this one? Thanks, ~SPH

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by ShmeeBegek

Thanks, I have another problem now..
*** Source Snippet Removed ***

On the last line there where I declare the iterator I get:
error: expected ';' before "it"

Just out of interest I changed Character to char and it worked perfectly... but there shouldn't be a reason for Character causing compilation errors:

*** Source Snippet Removed ***

Any ideas on this one? Thanks, ~SPH



cStringTree *getNode(list<Character*>strings,int nless=0)
{
// Traverse down the tree
cStringTree<Character,Type> *cnode = this;
int l = strings.size();
typename list<Character*>::iterator it;



Because Character is a template argument, the compiler doesn't know what list<Character*>::iterator is - it could be a nested type or a static data memeber. Thus, you need to tell the compiler what it's dealing with, which is what the typename keyword does.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!