Hello
I managed to compile Golden Cheetah for the first time yesterday.
I had to fix many compilation errors like these ones described in stackoverflow :
// Source -
https://stackoverflow.com/q/13416418// Posted by NaturalDemon, modified by community. See post 'Timeline' for change history
// Retrieved 2026-03-11, License - CC BY-SA 3.0
error C2589: '(' : illegal token on right side of '::'
error C2059: syntax error : '::'
I applied the fix be encompassing std::min and std::max calls into parentheses :
(std::min)(x, y);
both in GC sources and Qt sources (mainly in headers).
Should I commit these fixes to github?
Example :
diff --git a/src/Charts/PowerHist.h b/src/Charts/PowerHist.h
index 70c9c4b64..b965c09c9 100644
--- a/src/Charts/PowerHist.h
+++ b/src/Charts/PowerHist.h
@@ -218,7 +218,7 @@ class PowerHist : public QwtPlot
bool shadePaceZones() const; // check if zone shading is both wanted and possible
// Warning: the chart crashes when precision > 2
- static int validatePrecision(int precision) { return std::min(precision, 2); }
+ static int validatePrecision(int precision) { return (std::min)(precision, 2); }
// plot settings
RideItem *rideItem;
diff --git a/src/Train/MultiRegressionizer.h b/src/Train/MultiRegressionizer.h
index a115216e5..0e9e93a8c 100644
--- a/src/Train/MultiRegressionizer.h
+++ b/src/Train/MultiRegressionizer.h
@@ -727,8 +727,8 @@ public:
if (bestStdDev > epsilon)
isNewBest = true;
else {
- size_t bestMax = std::max(bestNum.size(), bestDen.size());
- size_t curMax = std::max(m_num.size(), m_den.size());
+ size_t bestMax = (std::max)(bestNum.size(), bestDen.size());
+ size_t curMax = (std::max)(m_num.size(), m_den.size());
Best regards
Gilles