player.h:149: error: base operand of ‘->’ is not a pointer player.h:151: error: invalid type argument of ‘unary *’ player.h:152: error: ISO C++ forbids declaration of ‘atr_itr’ with no type player.h:152: error: base operand of ‘->’ is not a pointer player.h:152: error: base operand of ‘->’ is not a pointer player.h:154: error: base operand of ‘->’ is not a pointer player.h:157: error: base operand of ‘->’ is not a pointer player.h:160: error: base operand of ‘->’ is not a pointer player.h:163: error: base operand of ‘->’ is not a pointer player.h:166: error: base operand of ‘->’ is not a pointer |
|
|
player.h:173: error: no matching function for call to ‘std::vector<Item, std::allocator<Item> >::erase(int&)’ /usr/include/c++/4.4/bits/vector.tcc:133: note: candidates are: __gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> > std::vector<_Tp, _Alloc>::erase(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >) [with _Tp = Item, _Alloc = std::allocator<Item>] /usr/include/c++/4.4/bits/vector.tcc:145: note: __gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> > std::vector<_Tp, _Alloc>::erase(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >, __gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >) [with _Tp = Item, _Alloc = std::allocator<Item>] player.h: In member function ‘void Player::RemoveItem(int)’: player.h:183: error: ISO C++ forbids declaration of ‘itr’ with no type player.h:183: error: cannot convert ‘__gnu_cxx::__normal_iterator<Item*, std::vector<Item, std::allocator<Item> > >’ to ‘int’ in initialization player.h:184: error: no matching function for call to ‘std::vector<Item, std::allocator<Item> >::erase(int&)’ /usr/include/c++/4.4/bits/vector.tcc:133: note: candidates are: __gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> > std::vector<_Tp, _Alloc>::erase(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >) [with _Tp = Item, _Alloc = std::allocator<Item>] /usr/include/c++/4.4/bits/vector.tcc:145: note: __gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> > std::vector<_Tp, _Alloc>::erase(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >, __gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >) [with _Tp = Item, _Alloc = std::allocator<Item>] player.h: In member function ‘void Player::CalculateStatsFromEquip()’: player.h:189: error: ISO C++ forbids declaration of ‘itr’ with no type player.h:189: error: cannot convert ‘__gnu_cxx::__normal_iterator<Item*, std::vector<Item, std::allocator<Item> > >’ to ‘int’ in initialization player.h:189: error: no match for ‘operator!=’ in ‘itr != ((Player*)this)->Player::EquipedItems.std::vector<_Tp, _Alloc>::end [with _Tp = Item, _Alloc = std::allocator<Item>]()’ player.h:191: error: ISO C++ forbids declaration of ‘iter’ with no type player.h:191: error: base operand of ‘->’ is not a pointer player.h:191: error: base operand of ‘->’ is not a pointer player.h:193: error: base operand of ‘->’ is not a pointer player.h:196: error: base operand of ‘->’ is not a pointer player.h:197: error: base operand of ‘->’ is not a pointer player.h:200: error: base operand of ‘->’ is not a pointer player.h:201: error: base operand of ‘->’ is not a pointer player.h:204: error: base operand of ‘->’ is not a pointer player.h:207: error: base operand of ‘->’ is not a pointer player.h:210: error: base operand of ‘->’ is not a pointer |
|
|
|
|
In file included from player.h:21, from game.h:20, from main.cpp:23: item.h:11: error: declaration of ‘Attribute ItemAttribute::Attribute’ include.h:60: error: changes meaning of ‘Attribute’ from ‘enum Attribute’ In file included from game.h:22, from main.cpp:23: enemy.h:28: error: declaration of ‘Item Loot::Item’ item.h:15: error: changes meaning of ‘Item’ from ‘struct Item’ In file included from game.h:22, from main.cpp:23: enemy.h:48: error: declaration of ‘std::vector<Loot, std::allocator<Loot> > Enemy::Loot’ enemy.h:25: error: changes meaning of ‘Loot’ from ‘struct Loot’ In file included from main.cpp:23: game.h:32: error: declaration of ‘Player Game::Player’ player.h:25: error: changes meaning of ‘Player’ from ‘class Player’ |
|
|
|
|
$ g++ main.cpp main.cpp:6: error: declaration of ‘Bar Foo::Bar’ main.cpp:2: error: changes meaning of ‘Bar’ from ‘struct Bar’ |
|
|
Bar Bar;
. You shouldn't do that. How can the compiler know, inside Foo's code, if you are referring to the type Bar or the variable Bar?BHXSpecter wrote: |
---|
For some reason it is thinking Bar is derived from Foo. |