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

I'm compiling Perl 5.6.1 on a Solaris 2.8 system using the compiler under /opt/SUNWspro/bin/cc - I have already resolved one problem with template expansion, but I've run into another. When make gets to the point where it is compiling hash.c, I get the following error:
`sh cflags hash.o` -DPERL_FOR_X2P hash.c CCCMD = cc -c -I/usr/local/include -D_LARGEFILE_SOURCE -D_F +ILE_OFFSET_BITS=64 -O "/usr/include/stdlib.h", line 165: identifier redeclared: getsubopt current : function(pointer to pointer to char, pointer to poin +ter to char, pointer to pointer to char) returning int previous: function(pointer to pointer to char, pointer to cons +t pointer to char, pointer to pointer to char) returning int : "/usr/ +include/stdio.h", line 267 "/usr/include/stdlib.h", line 189: identifier redeclared: getopt current : function(int, pointer to pointer to char, pointer to + char) returning int previous: function(int, pointer to const pointer to char, poin +ter to const char) returning int : "/usr/include/stdio.h", line 265 cc: acomp failed for hash.c *** Error code 2 make: Fatal error: Command failed for target `hash.o'
It seems like stdio.h has a definition of the function getopt that is different from something already compiled, my guess being this one: ./ext/SDBM_File/sdbm/dbe.c:getopt(int argc, char **argv, char *optstring) Anyone seen this before? I don't have enough experience compiling C to know whether this can be fixed by just changing the include paths, or if there's a compiler option to suppress the error or what. For the record, we're installing a legacy Perl system on a new box and need to keep 5.6.1. Thanks.

Replies are listed 'Best First'.
Re: Perl 5.6.1 compilation problems
by ambrus (Abbot) on May 13, 2004 at 17:00 UTC

    I have already resolved one problem with template expansion, but I've run into another.

    After resolving those problems, have you done a make clean and rerun Configure? If you haven't try it now.

      Yes, I've done make clean and have rerun Configure taking out some lib directories, to no avail. Still get the same error.
Re: Perl 5.6.1 compilation problems
by ysth (Canon) on May 13, 2004 at 18:27 UTC
    You might try compiling 5.6.2 and see if the problem is fixed, and if so, see what fixed it.
Re: Perl 5.6.1 compilation problems
by El Linko (Beadle) on May 13, 2004 at 20:24 UTC
    It may be worth looking at http://www.sunfreeware.com/ for a precompiled version.
    perl 5.6.1 for sparc solaris 8 is available at http://cgi.sun.com/freeware/package?id=2019