The RetroPie scriptmodule has some compilation flags set (per system) which might not be set when you manually compile. However, the compiler option that triggers the error (looks like -Werror) is not part of those flags. I just tested on 18.04 and the installation works fine, maybe the new gcc in 19.04 is more strict.
@Zathura
[OFF-TOPIC]
Sorry for being off-topic and unable to help you. But the "Zathura: A Space Adventure" movie was shown this afternoon on TV in my part of the world. It's an incredible coincidence or you were inspired by the movie you watched this afternoon... :-)
It's not a coincidence. I'm fully aware that "Zathura" is a ripoff of Jumanji, but I didn't know that back in '99 or '00 when I saw it on a library cart and chose it as my online handle thereafter. :p