bingmann / sound-of-sorting

The Sound of Sorting - "Audibilization" and Visualization of Sorting Algorithms
http://panthema.net/2013/sound-of-sorting/
GNU General Public License v3.0
836 stars 120 forks source link

Compilation error #6

Closed AndersonTorres closed 2 years ago

AndersonTorres commented 7 years ago

Hello!

I have tried to compile SoS but it is failing. The message is naturally cryptical, but here is it:

http://pastebin.com/i8eEzVjm

Specially, the last lines:

algorithms/wikisort.cpp: In instantiation of 'void WikiSortNS::Merge(const WikiSortNS::RangeI&, const WikiSortNS::RangeI&, const WikiSortNS::RangeI&, Comparison, typename std::iterator_traits<_Iter>::value_type*, size_t) [with Iterator = MyIterator; Comparison = ColoringComparator; typename std::iterator_traits<_Iter>::value_type = ArrayItem; size_t = long unsigned int]': algorithms/wikisort.cpp:274:26: required from 'void WikiSortNS::Sort(Iterator, Iterator, Comparison) [with Iterator = MyIterator; Comparison = ColoringComparator]' algorithms/wikisort.cpp:603:68: required from here algorithms/wikisort.cpp:129:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (A.length() <= cache_size) { ^ In file included from /nix/store/ndqahbwrnabiaszk0s8cblhgwhid5kn0-gcc-5.4.0/include/c++/5.4.0/algorithm:62:0, from algorithms/../WSortView.h:32, from algorithms/../SortAlgo.h:34, from algorithms/wikisort.cpp:31: /nix/store/ndqahbwrnabiaszk0s8cblhgwhid5kn0-gcc-5.4.0/include/c++/5.4.0/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = MyIterator; _Compare = ColoringComparator]': algorithms/wikisort.cpp:75:26: required from 'void WikiSortNS::InsertionSort(Iterator, Iterator, Comparison) [with Iterator = MyIterator; Comparison = ColoringComparator]' algorithms/wikisort.cpp:192:22: required from 'void WikiSortNS::Sort(Iterator, Iterator, Comparison) [with Iterator = MyIterator; Comparison = ColoringComparator]' algorithms/wikisort.cpp:603:68: required from here /nix/store/ndqahbwrnabiaszk0s8cblhgwhid5kn0-gcc-5.4.0/include/c++/5.4.0/bits/stl_algo.h:1842:14: error: no match for call to '(ColoringComparator) (MyIterator&, MyIterator&)' if (comp(i, __first)) ^ algorithms/wikisort.cpp:590:10: note: candidate: bool ColoringComparator::operator()(const ArrayItem&, const ArrayItem&) const bool operator()(const ArrayItem& a, const ArrayItem& b) const ^ algorithms/wikisort.cpp:590:10: note: no known conversion for argument 1 from 'MyIterator' to 'const ArrayItem&' make[1]: [Makefile:384: wikisort.o] Error 1 make: [Makefile:302: all-recursive] Error 1

bingmann commented 7 years ago

I have a gcc-5.4.0 as well and cannot reproduce the error. It compiles fine. The line numbers do not match the current master. Please try the github master branch.

AndersonTorres commented 7 years ago

Yep, it worked with git master! I was using the latest stable version, namely 0.6.5. Many thanks!

ghost commented 7 years ago

I also have errors with MSYS2