Hello,
At NCAR, our development system has GCC 12.4, and our GitHub-based CI system use GCC 13.3, and both build WRF-Hydro v5.4.0 correctly. 
However, the -DOUTPUT_CHAN_CONN is a rarely-used debug option that isn’t part of our standard test suite. I just tried building (with GCC 12.4) with that enabled and do indeed see the error you posted. We’ll look into it, but in the meantime, are you able to use the model without outputting channel connectivity? Typically that option is only used to validate the routing grid generated by the GIS tools and is not part of a standard run.
-Ryan