... the posted code runs on ubuntu 19.04
Yes - the C code you posted also works fine for me on Ubuntu-18.04, perl-5.30.0.
Apparently different operating systems can have different requirements.
Also bear in mind that requirements across different versions of perl might change.
The perlembed documentation that
I linked to earlier is for perl-5.30.0.
It might be more pertinent to check the perlembed docs by running
perldoc perlembed, as that will give you the documentation for the version of perl that you have installed.
Cheers,
Rob