#39 MinGW compile error

closed-fixed
None
5
2006-01-02
2005-06-18
ib
No

Compiling v2.6 with MinGW results in:

In file included from ../pdcurses/util.c:42:
/usr/i686-pc-mingw32/include/unistd.h:23: error: parse
error before "off_t"
/usr/i686-pc-mingw32/include/unistd.h:24: error: parse
error before "off_t"
/usr/i686-pc-mingw32/include/unistd.h: In function
`ftruncate':
/usr/i686-pc-mingw32/include/unistd.h:26: error: `__fd'
undeclared (first use in
this function)
/usr/i686-pc-mingw32/include/unistd.h:26: error: (Each
undeclared identifier is
reported only once
/usr/i686-pc-mingw32/include/unistd.h:26: error: for each
function it appears in
.)
/usr/i686-pc-mingw32/include/unistd.h:26: error:
`__length' undeclared (first us
e in this function)
make: *** [util.o] Error 1

In MinGW's sys/types.h we find:

#ifndef _NO_OLDNAMES
typedef _off_t off_t;
#endif

So there seems to be a conflict between -
D_NO_OLDNAMES in mingwin32.mak and #define
HAVE_UNISTD_H in curses.h for __MINGW32__.

Discussion

  • tharkonen
    tharkonen
    2005-07-19

    Logged In: YES
    user_id=1315372

    Is -D_NO_OLDNAMES actually required to get a working library
    with mingw?

    I'm asking this because removing it from the makefile
    results in an error-free compilation, and rudimentary tests
    (building and running a couple of simple curses programs)
    seem to imply that everything's working.

    But I assume there has to be some reason the definition is
    included, so...

     
    • assigned_to: nobody --> wmcbrine
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=27933

    Fixed in CVS. MinGW does not need HAVE_UNISTD_H. If you take
    it out, the build is successful.

     
    • status: closed-fixed --> pending-fixed
     
  • Logged In: YES
    user_id=27933

    ...nor does it need _NO_OLDNAMES, either, with recent
    versions on MinGW. But with some old versions, apparently,
    there's a beep() that gets defined in stdlib.h that
    conflicts with PDCurses' own beep(), unless _NO_OLDNAMES is
    defined. So that's why it's there.

     
  • ib
    ib
    2006-01-02

    • status: pending-fixed --> closed-fixed
     
  • ib
    ib
    2006-01-02

    Logged In: YES
    user_id=1268768

    Fixed with v2.7