C++ #include <atlbase.h> is not found

Viewed 79702

When I compile my C++ program in Visual Studio Express it says that it can't find atlbase.h. Am I missing some SDK or something?

9 Answers

Visual Studio 2017

When running the Visual Studio Installer, select the Individual components tab, and under SDKs, libraries, and frameworks make sure Visual C++ ATL Support is selected. VS Installer Visual C++ ATL Support selected

Solution for Visual Studio 2017 Express edition

I had the same error when building a COM C++ project in Visual Studio 2017 Express edition. As mentioned by several users here, ATL support is not included with the Express edition of Visual Studio. So to build a C++ COM/ATL project you need at least the Community edition.

If you really need to use the Express edition, you can download and install the Build Tools for Visual Studio 2017. Make sure to enable the 'Visual C++ ATL for x86 and x64' component during the setup.

After that add additional VC++ directories in the project properties:

  • Include directories: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\atlmfc\include
  • Library directories: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\atlmfc\lib\x86

The VC++ compiler should now be able to find the ATL source and library files.

I have not yet seen anyone mention Visual Studio 2015 (MSBuild 14.0). In this case I've had to download Visual C++ BuildTools (found here: https://visualstudio.microsoft.com/vs/older-downloads/). After having installed this, running the installer again allowed me to modify the installation and include the ATL libs.

Hope this helps anyone that is still using MSBuild 14.0

Related