問題描述
我想在我的代碼中使用 #include
但發(fā)生了這個(gè)錯(cuò)誤:
I want to use #include<dirent.h>
in my code but this error happen:
無法打開包含文件:'dirent.h': 沒有那個(gè)文件或目錄
Cannot open include file: 'dirent.h': No such file or directory
我該如何解決這個(gè)問題?
How can I solve this problem ?
推薦答案
因?yàn)檫@個(gè)頭文件不是 MSVC 自帶的.因此它找不到它!
Because this header file doesn't come with MSVC. Hence it cannot find it!
它帶有 C POSIX 庫.維基百科說,
dirent.h 已知包含在以下編譯器:
dirent.h is known to be included in the following compilers:
- Turbo C++ (DOS)
- GCC(跨平臺(tái))
- MinGW (Microsoft Windows)
- Borland C++ Builder (Microsoft Windows)
Microsoft Visual C++ 不包括目錄.h
Microsoft Visual C++ does not include dirent.h
但是,您可以下載dirent.h 的免費(fèi) Windows 實(shí)現(xiàn),您可以將其與 Microsoft Visual Studio 一起使用.
However, you can download free Windows implementation of dirent.h which you can use with Microsoft Visual Studio.
這篇關(guān)于<dirent.h>在 Visual Studio 2010 或 2008 中的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!