Closed anujt21 closed 1 year ago
The current repository works in g++-9
and g++-10
. I'm able to reproduce the issue in g++-11
. Maybe a version bump of cxxopts
is all we need
After bumping cxxopts
to 3.0.0, I'm not seeing the issue anymore with g++-9
, g++-10
, or g++-11
Thanks for the catch
When I was trying to build the simulator I got the following error:
`
In file included from /home/anuj/RANC/simulator/src/main.cpp:9: /home/anuj/RANC/simulator/extern/cxxopts.hpp: In member function ‘void cxxopts::values::detail::SignedCheck<T, true>::operator()(bool, U, const string&)’: /home/anuj/RANC/simulator/extern/cxxopts.hpp:488:43: error: ‘numeric_limits’ is not a member of ‘std’ 488 | if (u > static_cast(-(std::numeric_limits~~~~~ /home/anuj/RANC/simulator/extern/cxxopts.hpp:488:59: error: expected primary-expression before ‘>’ token 488 | if (u > static_cast(-(std::numeric_limits~~~~~ /home/anuj/RANC/simulator/extern/cxxopts.hpp:495:58: error: expected primary-expression before ‘>’ token 495 | if (u > static_cast((std::numeric_limits~~~~~ /home/anuj/RANC/simulator/extern/cxxopts.hpp:515:29: error: ‘numeric_limits’ is not a member of ‘std’ /home/anuj/RANC/simulator/extern/cxxopts.hpp:515:45: error: template argument 2 is invalid 515 | SignedCheck<T, std::numeric_limits~~~~~ /home/anuj/RANC/simulator/extern/cxxopts.hpp:556:52: error: expected primary-expression before ‘>’ token 556 | constexpr auto umax = (std::numeric_limits~~~~~ /home/anuj/RANC/simulator/extern/cxxopts.hpp:557:55: error: expected primary-expression before ‘>’ token 557 | constexpr bool is_signed = std::numeric_limits~~~~ | std::is_signed In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/exception_ptr.h:43, from /usr/include/c++/11/exception:153, from /usr/include/c++/11/ios:39, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/anuj/RANC/simulator/src/main.cpp:6: /usr/include/c++/11/type_traits:795:12: note: ‘std::is_signed’ declared here 795 | struct is_signed | ^~~~~ make[2]: [CMakeFiles/ranc_sim.dir/build.make:118: CMakeFiles/ranc_sim.dir/src/main.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:83: CMakeFiles/ranc_sim.dir/all] Error 2 make: *** [Makefile:91: all] Error 2`
I fixed it by adding the limits header file to cxxopts.hpp.