By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,983 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,983 IT Pros & Developers. It's quick & easy.

error: expected `;' before iter ?

P: 10
i am having in my code like

Expand|Select|Wrap|Line Numbers
  1. std::list<T*>::const_iterator iter=lst.begin();
and i am getting error


Expand|Select|Wrap|Line Numbers
  1.  error: expected `;' before âiterâ
  2. /root/INCLUDE/cw/gdlist.h:140: error: âiterâ was not declared in this scope
  3. /root/INCLUDE/cw/gdlist.h:142: error: âiterâ was not declared in this scope
  4. /root/INCLUDE/cw/gdlist.h: In member function âT*& CWGDList<T>::at(size_t)â:
  5. /root/INCLUDE/cw/gdlist.h:176: error: expected `;' before âiterâ
  6. /root/INCLUDE/cw/gdlist.h:178: error: âiterâ was not declared in this scope
  7. /root/INCLUDE/cw/gdlist.h:180: error: âiterâ was not declared in this scope
  8. /root/INCLUDE/cw/gdlist.h: In member function âconst T* CWGDList<T>::at(size_t) constâ:
  9. /root/INCLUDE/cw/gdlist.h:208: error: expected `;' before âiterâ
  10. /root/INCLUDE/cw/gdlist.h:210: error: âiterâ was not declared in this scope
  11. /root/INCLUDE/cw/gdlist.h:212: error: âiterâ was not declared in this scope
  12. /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDList<T>::clearAndDestroy()â:
  13. /root/INCLUDE/cw/gdlist.h:234: error: expected `;' before âiâ
  14. /root/INCLUDE/cw/gdlist.h:236: error: âiâ was not declared in this scope
  15. /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDList<T>::find(CWBoolean (*)(const T*, const void*), const void*) constâ:
  16. /root/INCLUDE/cw/gdlist.h:270: error: expected `;' before âiterâ
  17. /root/INCLUDE/cw/gdlist.h:272: error: âiterâ was not declared in this scope
  18. /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDList<T>::insertAt(size_t, T*)â:
  19. /root/INCLUDE/cw/gdlist.h:372: error: expected `;' before âiterâ
  20. /root/INCLUDE/cw/gdlist.h:374: error: âiterâ was not declared in this scope
  21. /root/INCLUDE/cw/gdlist.h:376: error: âiterâ was not declared in this scope
  22. /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDList<T>::remove(CWBoolean (*)(const T*, const void*), const void*)â:
  23. /root/INCLUDE/cw/gdlist.h:460: error: expected `;' before âiterâ
  24. /root/INCLUDE/cw/gdlist.h:462: error: âiterâ was not declared in this scope
  25. /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDList<T>::removeReference(const T*)â:
  26. /root/INCLUDE/cw/gdlist.h:504: error: expected `;' before âiterâ
  27. /root/INCLUDE/cw/gdlist.h:506: error: âiterâ was not declared in this scope
  28. /root/INCLUDE/cw/gdlist.h: At global scope:
  29. /root/INCLUDE/cw/gdlist.h:570: error: type âstd::list<T*, std::allocator<T*> >â is not derived from type âCWGDListIterator<T>â
  30. /root/INCLUDE/cw/gdlist.h:570: error: expected â;â before âiterâ
  31. /root/INCLUDE/cw/gdlist.h: In constructor âCWGDListIterator<T>::CWGDListIterator(CWGDList<T>&)â:
  32. /root/INCLUDE/cw/gdlist.h:588: error: class âCWGDListIterator<T>â does not have any field named âiterâ
  33. /root/INCLUDE/cw/gdlist.h: In member function âCWBoolean CWGDListIterator<T>::atFirst() constâ:
  34. /root/INCLUDE/cw/gdlist.h:608: error: âiterâ was not declared in this scope
  35. /root/INCLUDE/cw/gdlist.h: In member function âCWBoolean CWGDListIterator<T>::atLast() constâ:
  36. /root/INCLUDE/cw/gdlist.h:624: error: âiterâ was not declared in this scope
  37. /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDListIterator<T>::findNextReference(const T*)â:
  38. /root/INCLUDE/cw/gdlist.h:642: error: âiterâ was not declared in this scope
  39. /root/INCLUDE/cw/gdlist.h:648: error: âiterâ was not declared in this scope
  40. /root/INCLUDE/cw/gdlist.h:652: error: âiterâ was not declared in this scope
  41. /root/INCLUDE/cw/gdlist.h:658: error: âiterâ was not declared in this scope
  42. /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDListIterator<T>::key() constâ:
  43. /root/INCLUDE/cw/gdlist.h:694: error: âiterâ was not declared in this scope
  44. /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDListIterator<T>::operator()()â:
  45. /root/INCLUDE/cw/gdlist.h:712: error: âiterâ was not declared in this scope
  46. /root/INCLUDE/cw/gdlist.h:716: error: âiterâ was not declared in this scope
  47. /root/INCLUDE/cw/gdlist.h:724: error: âiterâ was not declared in this scope
  48. /root/INCLUDE/cw/gdlist.h:730: error: âiterâ was not declared in this scope
  49. /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::operator++()â:
  50. /root/INCLUDE/cw/gdlist.h:758: error: âiterâ was not declared in this scope
  51. /root/INCLUDE/cw/gdlist.h:770: error: âiterâ was not declared in this scope
  52. /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::operator--()â:
  53. /root/INCLUDE/cw/gdlist.h:786: error: âiterâ was not declared in this scope
  54. /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::operator+=(size_t)â:
  55. /root/INCLUDE/cw/gdlist.h:806: error: âiterâ was not declared in this scope
  56. /root/INCLUDE/cw/gdlist.h:822: error: âiterâ was not declared in this scope
  57. /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::operator-=(size_t)â:
  58. /root/INCLUDE/cw/gdlist.h:846: error: âiterâ was not declared in this scope
  59. /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDListIterator<T>::remove()â:
  60. /root/INCLUDE/cw/gdlist.h:874: error: âiterâ was not declared in this scope
  61. /root/INCLUDE/cw/gdlist.h:876: error: âiterâ was not declared in this scope
  62. /root/INCLUDE/cw/gdlist.h:880: error: âiterâ was not declared in this scope
  63. /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::reset()â:
  64. /root/INCLUDE/cw/gdlist.h:906: error: âiterâ was not declared in this scope
  65. /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::toFirst()â:
  66. /root/INCLUDE/cw/gdlist.h:924: error: âiterâ was not declared in this scope
  67. /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::toLast()â:
  68. /root/INCLUDE/cw/gdlist.h:942: error: âiterâ was not declared in this scope
can any body help me plz, thanks in advance
Dec 15 '10 #1
Share this Question
Share on Google+
1 Reply


P: 14
It looks like you forgot to
#include <list>
Dec 15 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.