[Almost Solved] Unreal fails to read environment variable and fails to detect Visual Studio

OS: Windows 8

Compiled Unreal from Github Source.

I have VS2013 Express installed and my environment variable is correctly set.

2675-environmentvariable.png

However Unreal does not detect it. When i create a new C++ project and try to open VS i get this message:


I also have to manually add include path and library path in every new project i create. I did this for UE4.sln too (the one created after using GenerateProjectFiles.bat) GenerateProjectFiles.bat also failed to detect VS2013 installation. I had to manually add the path in VCToolChain.cs.

Another problem is when i compile game code in editor i get this error:


And this is what is shown in Message Log:


Is Visual Studio 2013 Express really supported? Or is it because am using Windows 8?

Thats really odd. did you follow the video here:
link text

i mean exactly ? did you try using visual studio 2013 professional instead ?

#Essential Thing to Do

Did you do this already?

It’s essential!

Rama

Yes i followed that video step by step. UE4 solution compiles fine. No errors or anything. I even modified the UI a little bit. The var VS2013Path in VCToolChain.cs always returns empty. :confused:

No i dont have VS2013 Pro. Should i get that?

Yes i already did that. The GenerateProjectFiles.bat didnt worked for me even after changing that because var VS2013Path in VCToolChain.cs was always returing empty. So i had to manually give the path in VCToolChain.cs which gave me the project files. I can compile UE4 source, however i cannot compile new projects in unreal editor and cannot open solutions from unreal editor.

I’m sorry it’s causing you trouble. We’ve made a number of fixes to Visual Studio Express support after shipping our first release. Our code integration process is a little backwards since we’re using a different source control system internally, but I’ve set up a pull request for it on GitHub if you want to grab it early:

https://github.com/EpicGames/UnrealEngine/pull/18

The changes to the IncludeDirectories and LibraryDirectories in the project should not be necessary; UnrealBuildTool doesn’t use these variables. What problems were you seeing from that?

Hi Ben,

I added your code changes to my build and did a full UE4 rebuid but still the problem exists.

I have to add IncludeDirectories and LibraryDirectories otherwise i get errors like this:

Error List:

Output log:

After adding IncludeDirectories and LibraryDirectories build was success:

Output Log:

If you dont mind can i personally email you with every detail? Its much comfortable for me cause i can add pictures of all errors. But if you prefer here we can continue here. Please let me know.

Those settings should be automatically added by the .props file for the platform toolset (eg: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v100\Microsoft.Cpp.Win32.v100.props).

Have you tried repairing your Visual Studio installation? It sounds like it’s missing some global configuration files for MSBuild.

When i first installed VS2013 and tried to run GenerateProjectFiles.bat i get an error saying msbuild.exe was not recognized as an internal command. So i modified the PATH environment variable and added C:\Windows\Microsoft.NET\Framework\v4.0.30319 (Thanks to Google). Then that error was gone.

2991-pathvariable.png

@Jamie Dale: I dont have that path. In this folder C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms i only have a folder called x64 and inside that theres only one file: Microsoft.Build.CPPTasks.x64.dll

I have this folder that contains only 2 files C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\Win32\PlatformToolsets\v120 and they are Toolset.props and Toolset.targets

Ah, yeah, I was checking on a PC which also had VS2010 installed which is where the v100 came from. It seems like C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120 is the correct directory for VS2013 targets.

It’s strange though, I’ve never had to tell VS where to find the platform header files/libraries as it’s always been set-up globally. Does this also happen if you make a blank project in VS and then add the following to a main.cpp file?

#include <Windows.h>
int main()
{
    return 0;
}

Hi Jamie,

As you said i created a new EmptyProject and added cpp source with your code. It compiled fine without any errors and it also added all the necessary paths in VC++ Directories.

@Jamie and Ben,

I was narrowing the issue and it seems the problem is with this line in VSAccessorModule.cpp:

FProcHandle WorkerHandle = FPlatformProcess::CreateProc(*ExecutablePath, *Params, true, false, false, nullptr, 0, nullptr, nullptr);

With the help of UE_LOG() i can see the Executable Path and Solution Path are all valid. I still dont understand why WorkerHandle is not valid

In-Editor (See the putput log):

Code:

Running Unreal Engine 4 as Administrator launches VS2013. However one last problem remains. I still cant compile via in-game. This error pops up when compiling:

And the message log…

Hi,

I’m having the same exact problems on my machine.

  • Win7
  • UE4 from github
  • VS2013 Express for Windows desktop

Can’t open VS from UE4 editor.
The class doesn’t open after adding/creating it in the editor
I have to browse to the project folder and open the solution manually. When the solution is open, it’s missing almost all the include files and the predefined MACROS

I removed UE4 and VS2013 Express and reinstalled many times and still experience the same problems. Can’t find a solution anywhere.