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.

In reply to Perl 5.6.1 compilation problems by brinogordon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.