XBT source got error.

120 views
Skip to first unread message

David

unread,
Dec 3, 2013, 10:31:19 AM12/3/13
to xbt-t...@googlegroups.com
Can't install xbtt from source: http://xbt.googlecode.com/svn/trunk/xbt/Tracker because file /Tracker/server.cpp on line 189: " for (auto& j : i->second.peers) " will cause this error:
[root@vps Tracker]# ./make.sh
server.cpp: In function 'void read_db_torrents_sql()':
server.cpp:195: error: expected initializer before ':' token
server.cpp:200: error: could not convert 'm_torrents.boost::unordered_map<Key, T, Hash, Pred, Alloc>::erase [with Key = std::array<char, 20u>, T = t_torrent, Hash = boost::hash<std::array<char, 20u> >, Pred = std::equal_to<std::array<char, 20u> >, Alloc = std::allocator<std::pair<const std::array<char, 20u>, t_torrent> >](boost::unordered_detail::hash_const_iterator<std::allocator<std::pai
r<const std::array<char, 20u>, t_torrent> >, boost::unordered_detail::ungrouped>(((const boost::unordered_detail::hash_iterator<std::allocator<std::pair<const std::array<char, 20u>, t_torrent> >, boost::unordered_detail::ungrouped>&)((const boost::unordered_detail::hash_iterator<std::allocator<std::pair<const std::array<char, 20u>, t_torrent> >, boost::unordered_detail::ungrouped>*)(& i)))))' to 'bool'
server.cpp:201: error: expected primary-expression before '}' token
server.cpp:201: error: expected ')' before '}' token
server.cpp:201: error: expected primary-expression before '}' token
server.cpp:201: error: expected ';' before '}' token
[root@vps Tracker]#

So PLEASE CHANGE line 189 to: " BOOST_FOREACH(auto& j, i->second.peers) "

Vladimir Fedyay

unread,
Dec 14, 2013, 10:45:55 AM12/14/13
to xbt-t...@googlegroups.com
I had the same problem with compiling tracker on latest CentOS (6.5) couple days ago.
This type of range syntax in operator "for" can't be compiled by my version of gcc.
Line 189 in server.cpp was changed in revision 2397. So I've downloaded revision 2396 for compilation.
Updating gcc to 4.7 in CentOS is planned in version 7, as I understand.
Reply all
Reply to author
Forward
0 new messages