Subject: | Error compiling DNS.c on HP-UX |
When trying to install Net-DNS-0.37 into Perl 5.6.1 on an HP-UX 11.00 system, the ANSI-C compiler reports the following errors:
/usr/bin/perl /opt/perl5/5.6.1/lib/private/ExtUtils/xsubpp -typemap /opt/perl5/5.6.1/lib/private/ExtUtils/typemap DNS.xs > DNS.xsc && mv DNS.xsc DNS.c
cc -c -D_HPUX_SOURCE -Ae -z +z -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O3 -DVERSION=\"0.37\" -DXS_VERSION=\"0.37\" +z "-I/opt/perl5/5.6.1/lib/private/PA-RISC1.1/CORE" DNS.c
cc: "/usr/include/sys/magic.h", line 28: error 1587: Redeclaration of tag "magic".
cc: "/usr/include/sys/magic.h", line 28: error 1595: Redeclaration of members.
cc: "/usr/include/sys/magic.h", line 33: error 1713: Illegal redeclaration for identifier "MAGIC".
*** Error exit code 1
The problem is that `perl.h' has already declared the "magic/MAGIC"
structure. The following patch to DNS.xs fixes the problem:
+#ifdef _HPUX_SOURCE
+#define _SYS_MAGIC_INCLUDED
+#endif
#include "EXTERN.h"
#include "perl.h"