tdwilson58 has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to compile perl 5.10 on aix 5.2 using gcc (I've tried gcc versions 3.3.2 and 4.0.
When compiling the pp_sys.c module, I get this error in multiple places:

dereferencing pointer to incomplete type

The only solution I've found was someone who cried "uncle" and bought the IBM C compiler, but it should work with gcc.

I've successfully compiled this on an aix 5.3 server, but I can't upgrade this 5.2 server because it's a vendor box.

Here's the complete output:

Thanks!

`sh cflags "optimize='-O'" pp_sys.o` pp_sys.c CCCMD = gcc -maix32 -DPERL_CORE -c -D_ALL_SOURCE -D_ANSI_C_ +SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -fno-strict-aliasing -pipe + -I/usr/local/include -D_LARGE_FILES -std=c89 -O -Wall -W -Wendif- +labels pp_sys.c: In function `S_dooneliner': pp_sys.c:3595: warning: initialization discards qualifiers from pointe +r target type pp_sys.c:3609: warning: comparison between signed and unsigned pp_sys.c: In function `S_my_localtime': pp_sys.c:4401: warning: comparison between signed and unsigned pp_sys.c: In function `Perl_pp_ghostent': pp_sys.c:4644: warning: implicit declaration of function `gethostbynam +e' pp_sys.c:4644: warning: assignment makes pointer from integer without +a cast pp_sys.c:4656: warning: implicit declaration of function `gethostbyadd +r' pp_sys.c:4656: warning: assignment makes pointer from integer without +a cast pp_sys.c:4663: warning: implicit declaration of function `gethostent' pp_sys.c:4663: warning: assignment makes pointer from integer without +a cast pp_sys.c:4683: error: dereferencing pointer to incomplete type pp_sys.c:4684: error: dereferencing pointer to incomplete type pp_sys.c:4684: error: dereferencing pointer to incomplete type pp_sys.c:4687: error: dereferencing pointer to incomplete type pp_sys.c:4693: error: dereferencing pointer to incomplete type pp_sys.c:4694: error: dereferencing pointer to incomplete type pp_sys.c:4695: error: dereferencing pointer to incomplete type pp_sys.c:4696: error: dereferencing pointer to incomplete type pp_sys.c:4703: error: dereferencing pointer to incomplete type pp_sys.c:4704: error: dereferencing pointer to incomplete type pp_sys.c:4630: warning: unused variable `elem' pp_sys.c: In function `Perl_pp_gnetent': pp_sys.c:4731: warning: implicit declaration of function `getnetbyname +' pp_sys.c:4731: warning: assignment makes pointer from integer without +a cast pp_sys.c:4740: warning: implicit declaration of function `getnetbyaddr +' pp_sys.c:4740: warning: assignment makes pointer from integer without +a cast pp_sys.c:4747: warning: implicit declaration of function `getnetent' pp_sys.c:4747: warning: assignment makes pointer from integer without +a cast pp_sys.c:4768: error: dereferencing pointer to incomplete type pp_sys.c:4770: error: dereferencing pointer to incomplete type pp_sys.c:4776: error: dereferencing pointer to incomplete type pp_sys.c:4777: error: dereferencing pointer to incomplete type pp_sys.c:4778: error: dereferencing pointer to incomplete type pp_sys.c:4779: error: dereferencing pointer to incomplete type pp_sys.c: In function `Perl_pp_gprotoent': pp_sys.c:4804: warning: implicit declaration of function `getprotobyna +me' pp_sys.c:4804: warning: assignment makes pointer from integer without +a cast pp_sys.c:4812: warning: implicit declaration of function `getprotobynu +mber' pp_sys.c:4812: warning: assignment makes pointer from integer without +a cast pp_sys.c:4819: warning: implicit declaration of function `getprotoent' pp_sys.c:4819: warning: assignment makes pointer from integer without +a cast pp_sys.c:4829: error: dereferencing pointer to incomplete type pp_sys.c:4831: error: dereferencing pointer to incomplete type pp_sys.c:4837: error: dereferencing pointer to incomplete type pp_sys.c:4838: error: dereferencing pointer to incomplete type pp_sys.c:4839: error: dereferencing pointer to incomplete type pp_sys.c: In function `Perl_pp_gservent': pp_sys.c:4865: warning: implicit declaration of function `getservbynam +e' pp_sys.c:4865: warning: assignment makes pointer from integer without +a cast pp_sys.c:4877: warning: implicit declaration of function `getservbypor +t' pp_sys.c:4877: warning: assignment makes pointer from integer without +a cast pp_sys.c:4884: warning: implicit declaration of function `getservent' pp_sys.c:4884: warning: assignment makes pointer from integer without +a cast pp_sys.c:4897: error: dereferencing pointer to incomplete type pp_sys.c:4901: error: dereferencing pointer to incomplete type pp_sys.c:4907: error: dereferencing pointer to incomplete type pp_sys.c:4908: error: dereferencing pointer to incomplete type pp_sys.c:4912: error: dereferencing pointer to incomplete type pp_sys.c:4914: error: dereferencing pointer to incomplete type pp_sys.c: In function `Perl_pp_shostent': pp_sys.c:4927: warning: implicit declaration of function `sethostent' pp_sys.c: In function `Perl_pp_snetent': pp_sys.c:4938: warning: implicit declaration of function `setnetent' pp_sys.c: In function `Perl_pp_sprotoent': pp_sys.c:4949: warning: implicit declaration of function `setprotoent' pp_sys.c: In function `Perl_pp_sservent': pp_sys.c:4960: warning: implicit declaration of function `setservent' pp_sys.c: In function `Perl_pp_ehostent': pp_sys.c:4971: warning: implicit declaration of function `endhostent' pp_sys.c: In function `Perl_pp_enetent': pp_sys.c:4983: warning: implicit declaration of function `endnetent' pp_sys.c: In function `Perl_pp_eprotoent': pp_sys.c:4995: warning: implicit declaration of function `endprotoent' pp_sys.c: In function `Perl_pp_eservent': pp_sys.c:5007: warning: implicit declaration of function `endservent'

Replies are listed 'Best First'.
Re: AIX compile error pp_sys.c
by zwon (Abbot) on Jun 08, 2009 at 21:07 UTC

    It looks like netdb.h missed, though there's no warning about it. Can you check if netdb.h exists and contains definitions of all these functions?

      There is a netdb.h file, but it's in the win32/include subdirectory, and this is aix.

        Like ikegami said you should check in your system's include directory. All these gethost... functions which are you getting warnings about should be declared in netdb.h, but for some reason they are not. Also this file should contain the definitions of various structures, e.g. struct hostent, and as these definitions wasn't included compiler can't determine memory size that it should allocate for these structures etc, that's why you're getting "dereferencing pointer to incomplete type" errors. I think that's the source of the problem.

        I think he meant in your system's include directory, not in the Perl distro.