Hi, I couldn't get past this error when trying to install the package 'interp'. I've just installed the latest version of R (4.3.0). Any help would be greatly appreciated. Thanks!
g++ -std=gnu++11 -I"/opt/R/4.3.0/lib/R/include" -DNDEBUG -I'/opt/R/4.3.0/lib/R/library/Rcpp/include' -I'/opt/R/4.3.0/lib/R/library/RcppEigen/include' -I/usr/local/include -fpic -g -O2 -c convexHull.cpp -o convexHull.o
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
from convexHull.cpp:31:
/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<Point2D*, std::vector >; _Tp = Point2D; _Compare = graham_scan(std::vector)::__lambda1]’:
/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<Point2D*, std::vector >; _Compare = graham_scan(std::vector)::__lambda1]’
/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<Point2D*, std::vector >; _Size = long int; _Compare = graham_scan(std::vector)::__lambda1]’
/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<Point2D*, std::vector >; _Compare = graham_scan(std::vector)::__lambda1]’
convexHull.cpp:85:6: required from here
/usr/include/c++/4.8.2/bits/stl_algo.h:2263:35: error: no match for call to ‘(graham_scan(std::vector)::__lambda1) (Point2D&, const Point2D&)’
while (__comp(*__first, __pivot))
^
convexHull.cpp:72:47: note: candidate is:
std::sort(points.begin(), points.end(), [&](Point2D &left, Point2D &right) {
^
convexHull.cpp:72:78: note: graham_scan(std::vector)::__lambda1
std::sort(points.begin(), points.end(), [&](Point2D &left, Point2D &right) {
^
convexHull.cpp:72:78: note: no known conversion for argument 2 from ‘const Point2D’ to ‘Point2D&’
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
from convexHull.cpp:31:
/usr/include/c++/4.8.2/bits/stl_algo.h:2266:34: error: no match for call to ‘(graham_scan(std::vector)::__lambda1) (const Point2D&, Point2D&)’
while (__comp(__pivot, *__last))
^
convexHull.cpp:72:47: note: candidate is:
std::sort(points.begin(), points.end(), [&](Point2D &left, Point2D &right) {
^
convexHull.cpp:72:78: note: graham_scan(std::vector)::__lambda1
std::sort(points.begin(), points.end(), [&](Point2D &left, Point2D &right) {
^
convexHull.cpp:72:78: note: no known conversion for argument 1 from ‘const Point2D’ to ‘Point2D&’
make: *** [convexHull.o] Error 1
ERROR: compilation failed for package ‘interp’