Error trying to compile the newest Honey

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
ChiefPushesWood
Posts: 58
Joined: Thu Nov 08, 2018 5:30 pm
Full name: Chief PushesWood

Error trying to compile the newest Honey

Post by ChiefPushesWood » Thu Aug 29, 2019 3:38 pm

Hey Folks,
I was trying to compile the newest Honey this morning. Unfortunately, I keep getting this error but I don't really understand what it means. Can you advise?

Code: Select all

material.cpp: In function 'Material::Entry* Material::probe(const Position&)':
material.cpp:133:64: error: call of overloaded 'clamp(Value, Value, Value)' is ambiguous
  133 |   Value npm   = clamp(npm_w + npm_b, EndgameLimit, MidgameLimit);
      |                                                                ^
In file included from position.h:30,
                 from endgame.h:31,
                 from material.h:25,
                 from material.cpp:25:
bitboard.h:261:38: note: candidate: 'constexpr const T& clamp(const T&, const T&, const T&) [with T = Value]'
  261 | template<class T> constexpr const T& clamp(const T& v, const T& lo, const T&  hi) {
      |                                      ^~~~~
In file included from C:/msys64/mingw64/include/c++/9.2.0/algorithm:62,
                 from movegen.h:25,
                 from movepick.h:29,
                 from thread.h:32,
                 from material.cpp:26:
C:/msys64/mingw64/include/c++/9.2.0/bits/stl_algo.h:3713:5: note: candidate: 'constexpr const _Tp& std::clamp(const _Tp&, const _Tp&, const _Tp&) [with _Tp = Value]'
 3713 |     clamp(const _Tp& __val, const _Tp& __lo, const _Tp& __hi)
      |     ^~~~~
make[2]: *** [<builtin>: material.o] Error 1
make[2]: Leaving directory 'C:/msys64/home/DimEye/Stockfish-X5/src'
make[1]: *** [Makefile:630: gcc-profile-make] Error 2
make[1]: Leaving directory 'C:/msys64/home/DimEye/Stockfish-X5/src'
make: *** [Makefile:530: profile-build] Error 2
Can anyone give me an idea how to fix this? I reached out to the author but I know he's awful busy... maybe someone here can guide me?

Chief

MikeB
Posts: 3386
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

Re: Error trying to compile the newest Honey

Post by MikeB » Thu Aug 29, 2019 4:03 pm

ChiefPushesWood wrote:
Thu Aug 29, 2019 3:38 pm
Hey Folks,
I was trying to compile the newest Honey this morning. Unfortunately, I keep getting this error but I don't really understand what it means. Can you advise?

Code: Select all

material.cpp: In function 'Material::Entry* Material::probe(const Position&)':
material.cpp:133:64: error: call of overloaded 'clamp(Value, Value, Value)' is ambiguous
  133 |   Value npm   = clamp(npm_w + npm_b, EndgameLimit, MidgameLimit);
      |                                                                ^
In file included from position.h:30,
                 from endgame.h:31,
                 from material.h:25,
                 from material.cpp:25:
bitboard.h:261:38: note: candidate: 'constexpr const T& clamp(const T&, const T&, const T&) [with T = Value]'
  261 | template<class T> constexpr const T& clamp(const T& v, const T& lo, const T&  hi) {
      |                                      ^~~~~
In file included from C:/msys64/mingw64/include/c++/9.2.0/algorithm:62,
                 from movegen.h:25,
                 from movepick.h:29,
                 from thread.h:32,
                 from material.cpp:26:
C:/msys64/mingw64/include/c++/9.2.0/bits/stl_algo.h:3713:5: note: candidate: 'constexpr const _Tp& std::clamp(const _Tp&, const _Tp&, const _Tp&) [with _Tp = Value]'
 3713 |     clamp(const _Tp& __val, const _Tp& __lo, const _Tp& __hi)
      |     ^~~~~
make[2]: *** [<builtin>: material.o] Error 1
make[2]: Leaving directory 'C:/msys64/home/DimEye/Stockfish-X5/src'
make[1]: *** [Makefile:630: gcc-profile-make] Error 2
make[1]: Leaving directory 'C:/msys64/home/DimEye/Stockfish-X5/src'
make: *** [Makefile:530: profile-build] Error 2
Can anyone give me an idea how to fix this? I reached out to the author but I know he's awful busy... maybe someone here can guide me?

Chief
Sent you a PM. Let me know if that works.

ChiefPushesWood
Posts: 58
Joined: Thu Nov 08, 2018 5:30 pm
Full name: Chief PushesWood

Re: Error trying to compile the newest Honey

Post by ChiefPushesWood » Thu Aug 29, 2019 4:10 pm

Hey Mike,
It looks like the issue was that I had changed the -std=c++11 flag to 17. I changed that back to 11 and it seems to have sorted the issue.

Chief

Post Reply