Hallo die Nefensääääge schon wieder
Aktuell folgendes Problem:
Code
- pvp.cpp:442:2: error: no member named 'tr1' in namespace 'std'
- TR1_NS::unordered_set<CPVP*>::iterator it2 = it->second.begin();
- ^~~~~~
- ./stdafx.h:9:21: note: expanded from macro 'TR1_NS'
- #define TR1_NS std::tr1
- ~~~~~^
- pvp.cpp:442:24: error: 'CPVP' does not refer to a value
- TR1_NS::unordered_set<CPVP*>::iterator it2 = it->second.begin();
- ^
- ./pvp.h:5:7: note: declared here
- class CPVP
- ^
- pvp.cpp:442:29: error: expected expression
- TR1_NS::unordered_set<CPVP*>::iterator it2 = it->second.begin();
- ^
- pvp.cpp:442:32: error: use of class template 'iterator' requires template arguments
- TR1_NS::unordered_set<CPVP*>::iterator it2 = it->second.begin();
- ^
- /usr/include/c++/v1/iterator:539:29: note: template is declared here
- struct _LIBCPP_TEMPLATE_VIS iterator
- ^
- pvp.cpp:444:9: error: use of undeclared identifier 'it2'; did you mean 'it'?
- while (it2 != it->second.end())
- ^~~
- it
- pvp.cpp:434:23: note: 'it' declared here
- CPVPSetMap::iterator it = m_map_pkPVPSetByID.find(pkChr->GetPlayerID());
- ^
- pvp.cpp:444:13: error: invalid operands to binary expression ('CPVPSetMap::iterator' (aka '__map_iterator<__tree_iterator<std::__1::__value_type<unsigned int, boost::unordered::unordered_set<CPVP *, boost::hash<CPVP *>,
- std::__1::equal_to<CPVP *>, std::__1::allocator<CPVP *> > >, std::__1::__tree_node<std::__1::__value_type<unsigned int, boost::unordered::unordered_set<CPVP *, boost::hash<CPVP *>, std::__1::equal_to<CPVP *>,
- std::__1::allocator<CPVP *> > >, void *> *, int> >') and 'boost::unordered::unordered_set<CPVP *, boost::hash<CPVP *>, std::__1::equal_to<CPVP *>, std::__1::allocator<CPVP *> >::iterator' (aka 'c_iterator<ptr_node<CPVP *> >'))
- while (it2 != it->second.end())
- ~~~ ^ ~~~~~~~~~~~~~~~~
Ich habe das folgende dann in meiner stdafx.h gefunden, welche in de pvp.cpp included ist:
#ifdef __GNUC__
#include <tr1/unordered_map>
#define TR1_NS std::tr1
#else
#include <boost/unordered_map.hpp>
#define TR1_NS boost
#endif
Wie könnte ich den Fehler beheben?
Vielen Dank!
Best Regards,
Karl$lama