Debian 11 ITK Enum Casting
allisonbertrandsa opened this issue · 4 comments
I just compiled the AlizaMS master on Debian 11 with gcc version 10.2.1 20210110 (Debian 10.2.1-6). I had some casting errors with respect to the ITK library, for instance:
/home/allison/aliza/AlizaMS/common/commonutils.cpp: In static member function ‘static QString CommonUtils::convert_orientation_flag(unsigned int)’:
/home/allison/aliza/AlizaMS/common/commonutils.cpp:1893:34: error: could not convert ‘itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RIP’ from ‘const ValidCoordinateOrientationFlags’ {aka ‘const itk::SpatialOrientationEnums::ValidCoordinateOrientations’} to ‘unsigned int’
1893 | case itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RIP:
I was able to cast case statements in a couple of places (see attached git diffs) and complete the compile. I don't know if this is the ultimate right fix, but wanted to pass along the information.
Thank you. I didn't run into the issue on Debian. Probably it is some combination of ITK version and (maybe) "legacy" options. There were many changes in ITK enums. I shall look at the issue and make it more reliable. What ITK version did you use, was it one from the distribution?
P.S. The workaround is OK for now.
I initially used the ITK GitHub master, then also tried the ITK deb package, then rolled AlizaMS back to the released tar from 1.7.4 since I had compiled last year with Deb 9 without seeing this error. When the error persisted, I began to suspect it was related to the newer compiler or related library. Thanks for the feedback!
Thank you very much. Maybe it was compiler issue, i could not reproduce with GCC 12.1.0 on Debian 12. It should work now. Please re-open in case of problems.
Confirmed the changes work for me - thanks!