runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
wghou opened this issue · comments
Hi,
I download and compile the source code sucessfully. But when i run the software, i got the follwoing error:
Allocating 1.79769e+308 elements for vis ...
/home/wghou/github/Medical-Image-3D-Visualisation-Software/qt/widgets/src/double_slider.cpp:158:39: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
/home/wghou/github/Medical-Image-3D-Visualisation-Software/qt/widgets/src/double_slider.cpp:159:42: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
terminate called after throwing an instance of 'std::runtime_error'
what(): Could not initialize OpenGL functions.
Aborted (core dumped)
How to fix this error? Could you please help me. Thanks a lot!
Wenguo Hou
I run the program in debug mode, and i found this runtime error is from "double_slider.cpp":
this->setMin(INT_MAX);
this->setMax(INT_MAX);
maybe it's the this->setMin(INT_MAX);
cause the runtime error. So, i revise it as
this->setMin(INT_MIN);
this->setMax(INT_MAX);
the software run ok.
Please use Ubuntu 22.04.4 LTS as the authors recommanded. Otherwise, a lot of modifications would be needed.