Rev 2323, linux compile fails

Support forum for questions about compiling and running EQ2Emulator on Linux.

Moderator: Team Members

Post Reply
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Rev 2323, linux compile fails

Post by John Adams » Tue Dec 03, 2013 10:48 am

Again, Windows is being forgiving where Linux is not.
zoneserver.cpp:5186: error: no match for ‘operator=’ in ‘itr = ((ZoneServer*)this)->ZoneServer::m_timedActions.std::map<_Key, _Tp, _Compare, _Alloc>::erase [with _Key = TimedAction*, _Tp = unsigned int, _Compare = std::less<TimedAction*>, _Alloc = std::allocator<std::pair<TimedAction* const, unsigned int> >](itr)’
/usr/include/c++/4.4/bits/stl_tree.h:154: note: candidates are: std::_Rb_tree_iterator<std::pair<TimedAction* const,
unsigned int> >& std::_Rb_tree_iterator<std::pair<TimedAction* const, unsigned int> >::operator=(const std::_Rb_tree_iterator<std::pair<TimedAction* const, unsigned int> >&)

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Rev 2323, linux compile fails

Post by Jabantiz » Tue Dec 03, 2013 1:30 pm

iterator doesn't have a '=' operator??? I swear I have used erase like this before without issue, will look into this.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Rev 2323, linux compile fails

Post by Jabantiz » Tue Dec 03, 2013 6:16 pm

added #include <map> to zoneserver.cpp, hopefully that will fix the issue.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Rev 2323, linux compile fails

Post by Jabantiz » Tue Dec 03, 2013 6:22 pm

Jabantiz wrote:added #include <map> to zoneserver.cpp, hopefully that will fix the issue.
Actually nm that won't change anything as the header file already had that, going to revert that change.

And I think I found the actual problem, erase will return an iterator (the way I am using it) in c++ 11, earlier version return a void.
http://www.cplusplus.com/reference/map/map/erase/
so it depends what version of c++ your compiler uses.

Not sure how to handle this now...

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Rev 2323, linux compile fails

Post by John Adams » Wed Dec 04, 2013 11:03 am

Jabantiz wrote:Not sure how to handle this now...
Scat says he's on it, since it's a linux issue I asked him to look into it.

Stand by, Jab.

Edit: From Scat -
give the code on svn a try. basically you need 2 iterators. when you find an element you need to delete, you set the delete iterator to the looping iterator, then increment the looping iterator, then delete from the map where the delete iterator itr.

old code: itr = map.erase(itr);

new code: itr_delete = itr++; map.erase(itr_delete);
Make sense?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests