According to this article the OS-included compiler is only good for recompiling the kernel.
You must install/use a different compiler, either one from HP/Intel (certainly for some $$) or the free gcc.
gcc can be downloaded from the HP-UX Porting and Archive Center. See our HP-UX links