Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc 4.8 compile error #38

Merged
merged 2 commits into from
May 20, 2019
Merged

gcc 4.8 compile error #38

merged 2 commits into from
May 20, 2019

Conversation

duanguoxue
Copy link
Contributor

stl sort Compare function definition modify.

In file included from /usr/include/c++/4.8.2/algorithm:62:0,
from /root/code/SPTAG/AnnService/inc/Core/BKT/../Common/CommonUtils.h:14,
from /root/code/SPTAG/AnnService/inc/Core/BKT/Index.h:10,
from /root/code/SPTAG/AnnService/src/Core/BKT/BKTIndex.cpp:4:
/usr/include/c++/4.8.2/bits/stl_algo.h: In instantiation of '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<SPTAG::BasicResult*, std::vectorSPTAG::BasicResult >; _Tp = SPTAG::BasicResult; _Compare = bool ()(SPTAG::BasicResult&, SPTAG::BasicResult&)]':
/usr/include/c++/4.8.2/bits/stl_algo.h:2296:78: required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<SPTAG::BasicResult
, std::vectorSPTAG::BasicResult >; _Compare = bool ()(SPTAG::BasicResult&, SPTAG::BasicResult&)]'
/usr/include/c++/4.8.2/bits/stl_algo.h:2337:62: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<SPTAG::BasicResult
, std::vectorSPTAG::BasicResult >; _Size = long int; _Compare = bool ()(SPTAG::BasicResult&, SPTAG::BasicResult&)]'
/usr/include/c++/4.8.2/bits/stl_algo.h:5499:44: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<SPTAG::BasicResult
, std::vectorSPTAG::BasicResult >; _Compare = bool ()(SPTAG::BasicResult&, SPTAG::BasicResult&)]'
/root/code/SPTAG/AnnService/inc/Core/BKT/../Common/NeighborhoodGraph.h:246:80: required from 'void SPTAG::COMMON::NeighborhoodGraph::PartitionByTptree(SPTAG::VectorIndex
, std::vector&, int, int, std::vector<std::pair<int, int> >&) [with T = signed char]'
/root/code/SPTAG/AnnService/inc/Core/BKT/../Common/NeighborhoodGraph.h:72:114: required from 'void SPTAG::COMMON::NeighborhoodGraph::BuildGraph(SPTAG::VectorIndex*, const std::unordered_map<int, int>) [with T = signed char]'
/root/code/SPTAG/AnnService/src/Core/BKT/BKTIndex.cpp:150:13: required from 'SPTAG::ErrorCode SPTAG::BKT::Index::BuildIndex(const void
, int, int) [with T = signed char]'
/root/code/SPTAG/AnnService/inc/Core/DefinitionList.h:6:1: required from here
/usr/include/c++/4.8.2/bits/stl_algo.h:2263:35: error: invalid initialization of reference of type 'SPTAG::BasicResult&' from expression of type 'const SPTAG::BasicResult'
while (__comp(*__first, __pivot))
^
/usr/include/c++/4.8.2/bits/stl_algo.h:2266:34: error: invalid initialization of reference of type 'SPTAG::BasicResult&' from expression of type 'const SPTAG::BasicResult'
while (__comp(__pivot, *__last))
^
make[2]: *** [AnnService/CMakeFiles/SPTAGLib.dir/src/Core/BKT/BKTIndex.cpp.o] Error 1
make[1]: *** [AnnService/CMakeFiles/SPTAGLib.dir/all] Error 2

duanguoxue and others added 2 commits May 20, 2019 10:09
stl sort Compare function definition modify
Copy link
Member

@MaggieQi MaggieQi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your fix!

@MaggieQi MaggieQi merged commit fe329f0 into microsoft:master May 20, 2019
@duanguoxue duanguoxue deleted the patch-1 branch December 12, 2019 05:54
@duanguoxue duanguoxue restored the patch-1 branch December 12, 2019 05:55
@duanguoxue duanguoxue deleted the patch-1 branch December 12, 2019 06:02
t-phada pushed a commit to t-phada/SPTAG that referenced this pull request Aug 19, 2020
stl sort Compare function definition modify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants