Login Page - Create Account

Support Board


Date/Time: Wed, 12 Feb 2025 22:21:41 +0000



min() max() question

View Count: 837

[2020-08-26 15:11:54]
mkata - Posts: 103
I updated to the latest version and when re-compiling my studies I get this error for min() and max() functions.
It will compile if I replace max() with std::max() but this seems off.
Can you comment on this?
Thanks.



error: 'max' was not declared in this scope; did you mean 'std::max'?
| ^~~
| std::max
In file included from /usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/include/c++/algorithm:62,
from scstructures.h:24,
from sierrachart.h:22,
/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/include/c++/bits/stl_algo.h:3462:5: note: 'std::max' declared here
3462 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
[2020-08-26 17:18:13]
Sierra Chart Engineering - Posts: 104368
Use std::max().
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-11-13 01:53:40]
mkata - Posts: 103
This is just a note to myself:
The reason why this happened is because I had the "math.h" header file before "sierrachart.h".
If you put math.h after "sierrachart.h" then it will use max() and not std::max.
But it turns out I didn't need math.h at all because it is already included in "sierrachart.h".

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account