in visual studio 2010 or 2008

后端 未结 2 676
名媛妹妹
名媛妹妹 2020-12-01 05:55

I want to use #include in my code but this error happen:

Cannot open include file: \'dirent.h\': No such file or director

2条回答
  •  隐瞒了意图╮
    2020-12-01 06:54

    Because this header file doesn't come with MSVC. Hence it cannot find it!

    It comes with C POSIX library. The wikipedia says,

    dirent.h is known to be included in the following compilers:

    • Turbo C++ (DOS)
    • GCC (Cross-platform)
    • MinGW (Microsoft Windows)
    • Borland C++ Builder (Microsoft Windows)

    Microsoft Visual C++ does not include dirent.h

    However, you can download free Windows implementation of dirent.h which you can use with Microsoft Visual Studio.

提交回复
热议问题