that’s indeed a bit weird, since the hdr code is part of imgcodecs (no 3rdparty deps)
someone must have explicitly disabled WITH_IMGCODEC_HDR when building the libs.
not with what you have now.
build from github src / complain to the maintainer of your prebuilt package, i guess.
if it’s about python, try pip install opencv-python