#104 configure detects mkstemp on solaris 2.5

need info
closed-out-of-date
other (29)
5
2003-05-23
2002-01-31
Anonymous
No

configure detects mkstemp on solaris 2.5.1 but there
is none.

make chokes on htdig/EternalParser.cc
ExternalParser.cc:186: implicit declaration of
function `int mkstemp(...)'

Was easily fixed by #undef'ing HAVE_MKSTEMP in
include/htconfig.h, but the error remains: configure
does define HAVE_MKSTEMP...

Discussion

  • Gilles Detillieux

    • assigned_to: nobody --> ghutchis
    • labels: 105979 --> other
    • milestone: --> need info
    • status: open --> pending
     
  • Gilles Detillieux

    Logged In: YES
    user_id=149687

    If configure detects mkstemp, then it must be there in your
    C library. The error you're getting while compiling
    ExternalParser.cc indicates that the compiler didn't find a
    declaration of mkstemp in any of the header files, which is
    a different matter.

    Normally an implicit declaration gives a warning, not an
    error, though, so it's a bit surprising that this causes the
    whole compilation to abort. Which version and/or snapshot
    are you trying to compile here? Do you get the same error
    with the latest snapshots of both 3.1.6 and 3.2.0b4 in
    http://www.htdig.org/files/snapshots/?

    Not having access to Solaris 2.5, I can't say where the
    declaration of mkstemp() is found. Normally it's in stdlib.h
    or unistd.h, in /usr/include, both of which
    ExternalParser.cc includes. Could you search through your
    header files to see where mkstemp is declared and let us
    know? We can easily add more include statements if we know
    what to include. If the problem is with the 3.1.6 snapshot,
    please let us know ASAP because Geoff was going to put
    together the final release tonight.

     
  • Nobody/Anonymous

    Logged In: NO

    Versions I tried were 3.2.0 b3 and the newest b4 snapshot.
    both found mkstemp. But I did not, although I did
    find /usr/include -name \*.h -print | xargs grep mkstemp
    find /usr/local/include -name \*.h -print | xargs grep
    mkstemp
    So, there seems to be _no_ mkstemp declaration in my
    includes...

     
  • Gilles Detillieux

    • status: pending --> open
     
  • Gilles Detillieux

    Logged In: YES
    user_id=149687

    That is odd. Which compiler are you using? If it's gcc, you
    may want to look in /usr/lib/gcc (or /usr/local/lib/gcc) for
    a header that declares mkstemp. Still, an implicit
    declaration shouldn't cause a fatal error, so maybe the
    configure script is setting the compile options incorrectly
    in 3.2, which again raises the question of which compiler
    you're using, as well as how make is calling the compiler
    just before the error above.

     
  • Klaus Muth

    Klaus Muth - 2002-02-01

    Logged In: YES
    user_id=32906

    /usr/local>gcc -v
    Reading specs from
    /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.3/specs
    gcc version 2.95.3 20010315 (release)

    /usr/local>find . -type f -name \*.h | xargs grep mkstemp
    /usr/local>
    (the gcc is installed in /usr/local/)

    I looked again at it and noticed, it was not the latest
    3.2.0 b4 but htdig-3.1.6-012702 I downloaded yesterday.

     
  • Gilles Detillieux

    Logged In: YES
    user_id=149687

    Well, 3.1.6 was released this morning, so it's too late to
    change it. I still find it odd that an implicit declaration
    is treated as an error, especially with the 3.1.x series
    which doesn't "turn up the volume" on warnings like 3.2
    does. I guess your fix of #undef'in HAVE_MKSTEMP is the way
    we'll recommend to others in your situation to proceed,
    unless adding a declaration for it in ExternalParser.cc will
    work.

    On Solaris 8, I see that mkstemp() is declared in
    /usr/include/stdlib.h. Do you have that header installed on
    your system?

     
  • Klaus Muth

    Klaus Muth - 2002-02-04

    Logged In: YES
    user_id=32906

    Really strange:
    > nm /usr/lib/libc.so | grep mkstemp
    [3628] | 317184| 172|FUNC |GLOB |0 |8
    |mkstemp
    [1079] | 0| 0|FILE |LOCL |0 |ABS
    |mkstemp.c
    while:
    > grep mkstemp /usr/inclode/stdlib.h
    -- nothing --

    So, there seems to be a mkstemp function in Solaris
    2.5.1's libc.so, but there is no prototype for it in
    stdlib.h or any other header file I can find on my 2.5.1...

    Maybe, I can fix it with just prototyping mkstemp in
    ExternalParser.cc. I'll give it a try, if I find time for
    it.

     
  • Klaus Muth

    Klaus Muth - 2002-02-04

    Logged In: YES
    user_id=32906

    Phew!
    Just adding (with HAVE_MKSTEMP set)
    extern "C" {
    extern int mkstemp(char *xxx);
    }

    Between
    #include <stdio.h>
    ....
    class URL;

    in htdig/ExternalParser.h fixed the compile. But I had no
    time to test it yet. I don't use external parsers in
    ht://Dig...

     
  • Lachlan Andrew

    Lachlan Andrew - 2003-05-23
    • status: open --> closed-out-of-date
     

Log in to post a comment.