NoveroResearch/tragediy

Can´t build on Linux

bismosa opened this issue · 2 comments

Hello,

i tried to build this in Debian:
Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) i686 GNU/Linux
g++ --version: g++ (Debian 4.9.2-10) 4.9.2
On the Step "build" i get this error:
[ 11%] Building CXX object CMakeFiles/tragediy.dir/src/track/LaneArcTile.cpp.o In file included from /root/tragediy/src/track/LaneArcTile.cpp:22:0: /root/tragediy/inc/tragediy/util/Math.h:30:13: error: template declaration of ‘constexpr const T pi’ constexpr T pi = static_cast<T>(3.141592653589793238462643383279502884L); ^ /root/tragediy/src/track/LaneArcTile.cpp: In member function ‘virtual Vector2 LaneArcTile::getEndDirection() const’: /root/tragediy/src/track/LaneArcTile.cpp:46:81: error: ‘pi’ was not declared in this scope double angle = angleStart + length_ / radius_ + (radius_ > 0.0 ? 0.5 : -0.5) * pi<double>; ^ /root/tragediy/src/track/LaneArcTile.cpp:46:84: error: expected primary-expression before ‘double’ double angle = angleStart + length_ / radius_ + (radius_ > 0.0 ? 0.5 : -0.5) * pi<double>; ^ /root/tragediy/src/track/LaneArcTile.cpp: In member function ‘virtual BoundingBox LaneArcTile::getBoundingBox() const’: /root/tragediy/src/track/LaneArcTile.cpp:63:44: error: ‘pi’ was not declared in this scope if (std::ceil((angleStart - 0.0) / (2.0 * pi<double>)) <= std::floor((angleEnd - 0.0) / (2.0 * pi<double>))) ^ /root/tragediy/src/track/LaneArcTile.cpp:63:47: error: expected primary-expression before ‘double’ if (std::ceil((angleStart - 0.0) / (2.0 * pi<double>)) <= std::floor((angleEnd - 0.0) / (2.0 * pi<double>))) ^ /root/tragediy/src/track/LaneArcTile.cpp:63:47: error: expected ‘)’ before ‘double’ /root/tragediy/src/track/LaneArcTile.cpp:64:88: error: expected ‘)’ before ‘;’ token bb = ::getBoundingBox(bb, BoundingBox(midPoint + Vector2(1, 0) * std::fabs(radius_))); ^ /root/tragediy/src/track/LaneArcTile.cpp:65:36: error: ‘pi’ was not declared in this scope if (std::ceil((angleStart - 0.5 * pi<double>) / (2.0 * pi<double>)) <= std::floor((angleEnd - 0.5 * pi<double>) / (2.0 * pi<double>))) ^ /root/tragediy/src/track/LaneArcTile.cpp:65:39: error: expected primary-expression before ‘double’ if (std::ceil((angleStart - 0.5 * pi<double>) / (2.0 * pi<double>)) <= std::floor((angleEnd - 0.5 * pi<double>) / (2.0 * pi<double>))) ^ /root/tragediy/src/track/LaneArcTile.cpp:65:39: error: expected ‘)’ before ‘double’ /root/tragediy/src/track/LaneArcTile.cpp:66:88: error: expected ‘)’ before ‘;’ token bb = ::getBoundingBox(bb, BoundingBox(midPoint + Vector2(0, 1) * std::fabs(radius_))); ^ /root/tragediy/src/track/LaneArcTile.cpp:67:30: error: ‘pi’ was not declared in this scope if (std::ceil((angleStart - pi<double>) / (2.0 * pi<double>)) <= std::floor((angleEnd - pi<double>) / (2.0 * pi<double>))) ^ /root/tragediy/src/track/LaneArcTile.cpp:67:33: error: expected primary-expression before ‘double’ if (std::ceil((angleStart - pi<double>) / (2.0 * pi<double>)) <= std::floor((angleEnd - pi<double>) / (2.0 * pi<double>))) ^ /root/tragediy/src/track/LaneArcTile.cpp:67:33: error: expected ‘)’ before ‘double’ /root/tragediy/src/track/LaneArcTile.cpp:68:89: error: expected ‘)’ before ‘;’ token bb = ::getBoundingBox(bb, BoundingBox(midPoint + Vector2(-1, 0) * std::fabs(radius_))); ^ /root/tragediy/src/track/LaneArcTile.cpp:69:36: error: ‘pi’ was not declared in this scope if (std::ceil((angleStart - 1.5 * pi<double>) / (2.0 * pi<double>)) <= std::floor((angleEnd - 1.5 * pi<double>) / (2.0 * pi<double>))) ^ /root/tragediy/src/track/LaneArcTile.cpp:69:39: error: expected primary-expression before ‘double’ if (std::ceil((angleStart - 1.5 * pi<double>) / (2.0 * pi<double>)) <= std::floor((angleEnd - 1.5 * pi<double>) / (2.0 * pi<double>))) ^ /root/tragediy/src/track/LaneArcTile.cpp:69:39: error: expected ‘)’ before ‘double’ /root/tragediy/src/track/LaneArcTile.cpp:70:89: error: expected ‘)’ before ‘;’ token bb = ::getBoundingBox(bb, BoundingBox(midPoint + Vector2(0, -1) * std::fabs(radius_))); ^ /root/tragediy/src/track/LaneArcTile.cpp: In member function ‘virtual std::tuple<double, double> LaneArcTile::map(const Vector2&) const’: /root/tragediy/src/track/LaneArcTile.cpp:184:58: error: ‘pi’ was not declared in this scope double anglediff = std::fmod(angleStart - angle, 2.0 * pi<double>); ^ /root/tragediy/src/track/LaneArcTile.cpp:184:61: error: expected primary-expression before ‘double’ double anglediff = std::fmod(angleStart - angle, 2.0 * pi<double>); ^ /root/tragediy/src/track/LaneArcTile.cpp:186:26: error: expected primary-expression before ‘double’ anglediff += 2.0 * pi<double>; ^ /root/tragediy/src/track/LaneArcTile.cpp:192:58: error: ‘pi’ was not declared in this scope double anglediff = std::fmod(angle - angleStart, 2.0 * pi<double>); ^ /root/tragediy/src/track/LaneArcTile.cpp:192:61: error: expected primary-expression before ‘double’ double anglediff = std::fmod(angle - angleStart, 2.0 * pi<double>); ^ /root/tragediy/src/track/LaneArcTile.cpp:194:26: error: expected primary-expression before ‘double’ anglediff += 2.0 * pi<double>; ^ /root/tragediy/src/track/LaneArcTile.cpp:200:38: error: ‘pi’ was not declared in this scope else if (distance > 0.5 * length_ + pi<double> * std::fabs(radius_)) ^ /root/tragediy/src/track/LaneArcTile.cpp:200:41: error: expected primary-expression before ‘double’ else if (distance > 0.5 * length_ + pi<double> * std::fabs(radius_)) ^ /root/tragediy/src/track/LaneArcTile.cpp:200:41: error: expected ‘)’ before ‘double’ /root/tragediy/src/track/LaneArcTile.cpp: In member function ‘virtual Vector2 LaneArcTile::getDirectionOnLane(double) const’: /root/tragediy/src/track/LaneArcTile.cpp:229:80: error: ‘pi’ was not declared in this scope double angle = angleStart + length / radius_ + (radius_ > 0.0 ? 0.5 : -0.5) * pi<double>; ^ /root/tragediy/src/track/LaneArcTile.cpp:229:83: error: expected primary-expression before ‘double’ double angle = angleStart + length / radius_ + (radius_ > 0.0 ? 0.5 : -0.5) * pi<double>; ^ /root/tragediy/src/track/LaneArcTile.cpp: In member function ‘void LaneArcTile::writeArc(std::ostream&, const Vector2&, double, double, double, double, double, std::string) const’: /root/tragediy/src/track/LaneArcTile.cpp:245:162: error: ‘pi’ was not declared in this scope out << "<path d =\"M " << startPoint[0] << "," << startPoint[1] << " A " << std::fabs(radius) << "," << std::fabs(radius) << " 0 " << (angleEnd - angleStart > pi<double> ? 1 : 0) << " 1 " << endPoint[0] << "," << endPoint[1] << "\" style=\"fill:none; stroke:" << color << "; stroke-width:" << width << ";\" />\n"; ^ /root/tragediy/src/track/LaneArcTile.cpp:245:165: error: expected primary-expression before ‘double’ out << "<path d =\"M " << startPoint[0] << "," << startPoint[1] << " A " << std::fabs(radius) << "," << std::fabs(radius) << " 0 " << (angleEnd - angleStart > pi<double> ? 1 : 0) << " 1 " << endPoint[0] << "," << endPoint[1] << "\" style=\"fill:none; stroke:" << color << "; stroke-width:" << width << ";\" />\n"; ^ /root/tragediy/src/track/LaneArcTile.cpp:245:165: error: expected ‘)’ before ‘double’ /root/tragediy/src/track/LaneArcTile.cpp: In member function ‘virtual std::tuple<double, double> LaneArcTile::map(const Vector2&) const’: /root/tragediy/src/track/LaneArcTile.cpp:210:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1plus: all warnings being treated as errors CMakeFiles/tragediy.dir/build.make:100: recipe for target 'CMakeFiles/tragediy.dir/src/track/LaneArcTile.cpp.o' failed make[2]: *** [CMakeFiles/tragediy.dir/src/track/LaneArcTile.cpp.o] Error 1 CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/tragediy.dir/all' failed make[1]: *** [CMakeFiles/tragediy.dir/all] Error 2 Makefile:117: recipe for target 'all' failed make: *** [all] Error 2
What i am doing wrong?

BTW:
Is it possible to upload the tracks from the starter Kit as SVG?

Thanks for this!
Regards
Sascha

Hello Sascha,

your compiler does not support C++14 language features. Install at least gcc version 5. I added compiler version checks to the build system and added a short note to the readme. Let me know if you still get compilation errors.

We prefer to not upload the SVGs since they are derived from Anki copyrighted material.

Regards,
Tobias

Hello,
many thanks for the answer.
I have now installed Ubuntu 16.4 and compiling works without any error.
Many thanks for this!

Regards
Sascha