hypertidy / decido

Constrained polygon triangulation by 'ear cutting'
https://hypertidy.github.io/decido
Other
15 stars 3 forks source link

why is travis failing? #3

Closed mdsumner closed 6 years ago

mdsumner commented 6 years ago

I'd expect this is C++11 problems, but now have SystemRequirements, Makevars and environment variable in travis.yml ...

/usr/include/c++/4.8/bits/stl_vector.h:901:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const value_type& {aka const std::array<double, 2ul>&}’
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::array<double, 2ul>; _Alloc = std::allocator<std::array<double, 2ul> >; std::vector<_Tp, _Alloc>::value_type = std::array<double, 2ul>]
       push_back(value_type&& __x)
       ^
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<std::array<double, 2ul> >::value_type&& {aka std::array<double, 2ul>&&}’
make: *** [decido.o] Error 1
ERROR: compilation failed for package ‘decido’
* removing ‘/home/travis/build/hypertidy/decido/decido.Rcheck/decido’
virgesmith commented 6 years ago

Suggest* changing poly.push_back({pt}); to poly.push_back(pt); at decido.cpp:46? You're pushing a single element so not quite sure why the initialiser list syntax is there.

mdsumner commented 6 years ago

Thanks! That fixed the Linux build, though osx is still failing.

I'm going to put this aside for day or so, but I appreciate the feedback!

virgesmith commented 6 years ago

I think (some of) the OSX errors will go away if you explicitly #include <array> in earcut_hpp.cpp. What's the intent of earcut_hpp.cpp? It looks like a header and it's being #included like a header, so dont get why the cpp extension? (If it is meant to be a cpp file it should not be #included)

mdsumner commented 6 years ago

Oh that's just me not knowing what I'm doing! Mapbox calls it .hpp but check complains about that. I guess it should be .h Thanks again, will try

mdsumner commented 6 years ago

PASS! Thanks so much ;) (BTW, If you are trying to actually use this the logic for the geometry input is a bit iffy still but I'll get to that soon).