<Dirent.H> in Visual Studio 2010 or 2008

dirent.h in Visual Studio 2010 or 2008

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.

WINAPI C++ VS 2008 vs VS 2010

Most probably, the problem here is that your VS 2008 project was Multibyte CharacterSet based and VS 2010 project is UNICODE based.

Right-click on Project->Properties->General->Character Set

Change it to 'Use Multi-Byte Character Set'.

Alternatively, if you want to keep your code UNICODE based, then add _T before all the strings that you are defining.



Related Topics



Leave a reply



Submit