Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. error C2065: '_S_IFDIR' : undeclared identifier

error C2065: '_S_IFDIR' : undeclared identifier

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomlinuxdata-structureshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _Flaviu
    wrote on last edited by
    #1

    Trying to convert a linux project to windows, I met an error (from the subject of the post). I have a chance to use something else in windows case ?

    if(S_ISDIR(type))
    ....

    where type is defined as mode_t type ... and mode_t is another error:

    error C2061: syntax error : identifier 'mode_t'

    how can I solve these errors ? I seek on internet and I found something like:

    #if defined __WIN32__ || defined _WIN32 || defined _Windows
    #if !defined S_ISDIR
    #define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR)
    #endif
    #endif

    taken from here: c - Error: identifier "_S_IFDIR" is undefined - Stack Overflow[^]

    K L 2 Replies Last reply
    0
    • _ _Flaviu

      Trying to convert a linux project to windows, I met an error (from the subject of the post). I have a chance to use something else in windows case ?

      if(S_ISDIR(type))
      ....

      where type is defined as mode_t type ... and mode_t is another error:

      error C2061: syntax error : identifier 'mode_t'

      how can I solve these errors ? I seek on internet and I found something like:

      #if defined __WIN32__ || defined _WIN32 || defined _Windows
      #if !defined S_ISDIR
      #define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR)
      #endif
      #endif

      taken from here: c - Error: identifier "_S_IFDIR" is undefined - Stack Overflow[^]

      K Offline
      K Offline
      k5054
      wrote on last edited by
      #2

      googling s_isdir windows gives this hit: [Porting To Win32!!!!](https://www.linuxquestions.org/questions/programming-9/porting-to-win32-429334/). Seems like what you want. If not, maybe one of the other 27,000 results might help?

      1 Reply Last reply
      0
      • _ _Flaviu

        Trying to convert a linux project to windows, I met an error (from the subject of the post). I have a chance to use something else in windows case ?

        if(S_ISDIR(type))
        ....

        where type is defined as mode_t type ... and mode_t is another error:

        error C2061: syntax error : identifier 'mode_t'

        how can I solve these errors ? I seek on internet and I found something like:

        #if defined __WIN32__ || defined _WIN32 || defined _Windows
        #if !defined S_ISDIR
        #define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR)
        #endif
        #endif

        taken from here: c - Error: identifier "_S_IFDIR" is undefined - Stack Overflow[^]

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        See _stat Structure st_mode Field Constants | Microsoft Docs[^].

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups