Cannot open include file: 'atlbase.h': No such file or directory

For me these files are located here:

VS2010 - C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\atlbase.h
VS2008 - C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlbase.h

Please note ATL is part of Microsoft Visual Studio (but not the Express Edition). If you need get ATL for Express please take a look at this topic How to add WTL and ATL to visual studio c++ express 2008

I don't think copying atlbase.h and atlcom.hwill help you. You might try to get all atl*.h files and install required Microsoft Visual C++ Redistributable package.


ATL and MFC come with retail versions of VC++. It does not matter where you will place includes and libraries (atl*.lib) needed. Just provide the correct paths to them in IDE.


You don't need those headers for that code. Remove extern CComModule _Module; and the atl headers. Add #include <windows.h>.


Having the headers is certainly a step in the right direction, but you will also need the libraries in order to compile (unless everything is implemented in headers). You can place the headers where you like, just make sure the linker finds them (either in the default location* or by including the path as a flag).

*I don't know the default location for Windows.