#138 Unistd.h doesn't exist in VStudio.Net

Flex
open
GnuWin
Sources (36)
5
2013-01-23
2004-04-07
Anonymous
No

Hi all,

In Skel.c, line 35, unistd.h is include into your resultant
lexxed .cpp file, but this header file is Unix-specific(or so
my breif research would lead me to believe). My project
is using VC++.Net 2003 with GNUWin32 Bison. Here are
my Bison/Flex calls:

Bison:
bison.exe -v -o MYFile.y.cpp -d $(InputName).y

Flex:
flex.exe -i -t $(InputName).l > $(InputName).l.cpp

thanks

Alex Fennell
canuckavenger@yahoo.com

Discussion

  • GnuWin

    GnuWin - 2004-04-07

    Logged In: YES
    user_id=217802

    It exists in Mingw, where it is equivalent to including io.h and
    process.h

     
  • Nobody/Anonymous

    Logged In: NO

    yes, but you cannot compile when you get the the line in
    your MyFile.l.cpp that tried to include a file that doesn't exist.

     
  • GnuWin

    GnuWin - 2004-04-07

    Logged In: YES
    user_id=217802

    It will be included in the next ports of Bison and Flex. In the
    meantime, one can either download the Mingw set of headers
    (mingw-runtime) or create a dummy file that includes io.h and
    process.h

     
  • NeonElf

    NeonElf - 2009-07-23

    There is a related option that the WIN32 version doesn't support that could fix this. when I add:

    define YY_NO_UNISTD_H

    under Linux it complies without reference to that header and can be ported to win32 easily. However, it doesn't seem the windows version supports this define.

     
  • GnuWin

    GnuWin - 2009-07-23

    That's why the setup program and the developer archive (*-lib.zip) contain a unistd.h. Ensure that the folder where this is installed, is searched for include files by your compiler.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2013-01-23

    Is there any specific reason for not adding support for YY_NO_UNISTD_H to the Win32 version? It would be much preferred here, and having it in the Linux version only is a bit silly, no?

    The reason I am asking is, CMake does detect GnuWin32 Flex if it's in the path - but it does not detect %GnuWin32%/include/unistd.h. Support for YY_NO_UNISTD_H would be a neat sollution for this.

     
    Last edit: Martin Baute 2013-01-24