[Solved] Error: cannot find atlbase.h when compiling in VS2013 Express?

So the UBT (Unreal Build Tool) should be detecting if Express vs. Non Express is installed, the ATL support wasn’t shipped with VS Express.

Do you by chance have another full version of visual studio installed? That may be fooling the auto detection code.

VSAccessor.Build.cs

if (WindowsPlatform.bHasVisualStudioDTE)
{
	// This module requires atlbase.h to be included before Windows headers, so we can make use of shared PCHs.  This
	// module will always have its own private PCH generated, if necessary.
	PCHUsage = PCHUsageMode.NoSharedPCHs;
	Definitions.Add("WITH_VSEXPRESS=0");
}
else
{
	Definitions.Add("WITH_VSEXPRESS=1");
}

To work around it - you can probably comment all that out and just use

Definitions.Add("WITH_VSEXPRESS=1");

Hi guys,

When compiling the Unreal Engine 4 in Visual Studio 2013 Express the compiler errors because it cannot find the file “atlbase.h”.

Any ideas what the issue may be?

I have this problem and in my case I have a full version of VS 2012 installed. However, building solution in 2012 went ok without any errors.

Looks like we need to come up with a cleverer solution :smiley:

I have VS 2010 and VS 2012 installed (full versions), and VS 2013 express. I have encountered the same issue.

What worked for me, using VS 2013 Express, was to comment out the large block and instead use:

Definitions.Add("WITH_VSEXPRESS=1");

Just checked Perforce - looks like it was fixed yesterday :slight_smile: Should be migrated into GitHub in a few days; soon there won’t be any delay! :smiley:

To my understanding, UE4 was developed with Visual Studio 2012 in mind as the Windows IDE. Editing your code in it should be no issue. Jumping up to 2013 might introduce a few gotchyas, like you’ve found.

If it’s no big issue, Visual Studio 2012 should be your IDE of choice at the moment, until better integration with 2013 is deployed.

At Epic we’ve switched over to 2013. So it’s definitely ready for it, this is just an issue with having Express and non-express versions installed side by side. It should be fixed as soon as we do another push to GitHub.

Cheers,
Nick (Epic Games)

This fix also worked for me with having VS 2010 Professional and VS 2013 express.

Many thanks

Definitions.Add(“WITH_VSEXPRESS=1”); works for me too, using express with full 2010 installed. thanks guys.

Same here, thanks

Thanks guys!

Commenting out the code as described above and leaving:

Definitions.Add(“WITH_VSEXPRESS=1”);

…worked for me too :slight_smile:

There goes three hours of my precious compiling time…

This came in handy, thank you very much :slight_smile:

The fix for this problem is to change UEBuildWindows.cs.

The property bHasVisualStudioDTE will return true if you have more than one version of visual studio (and one of them is not express).

The fix is to add a check for the environment variable VisualStudioEdition (which exists in 2013 express).

The function becomes:

/** True if VS EnvDTE is available (false when building using Visual Studio Express) */
public static bool bHasVisualStudioDTE
{
	get
	{
		string envVSEdition = System.Environment.GetEnvironmentVariable("VisualStudioEdition");
		if (envVSEdition != null && envVSEdition.ToLower().IndexOf("express") != -1)
		{
			return false;
		}

		try
		{
			// Interrogate the Win32 registry
			return RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, RegistryView.Registry32).OpenSubKey("VisualStudio.DTE") != null;
		}
		catch(Exception) 
		{
			return false;
		}
	}
}

See my fix below, I also posted a pull request on github for 2 fixes.

Thanks Densohax, we have it fixed in mainline, there’s actually a better set of DDE variables you can check in the registry. We haven’t pushed the latest version to github yet…hopefully soon (eventually it will be realtime). We’re also working on a hotfix that will resolve it in the release branch.

It’s awesome to see people jumping into the code! :smiley:

Nice, I was also looking at some other ways to detect express but didn’t find those DDE variables!

Btw, it’s awesome to have access to the source :wink:

I was exhausted by that error.^^;;;;
Thanks to you I solved~ ^^

Aren’t you missing a } in your code?