VC++ directories not set on start - causing 2 errors

Hi,

when I get engine source, or when I start a new C++ project, in VS Properties / Configuration Properties / VC++ Directories are blank, only Executable Directories is fine, all the other ones require to select manually “inherit from parent…” and press Apply.

Compilation works afterwards, but it causes an error message on C++ project start, and probably it is related to not working hot reload. I use 4.7.2. and VS2013 Community, project path contain no special characters, PATH is set properly. (But I’m using a non-English Win7, and my user name contains an ‘á’)

C++ project start problem is described here, which is solved by the process described above (message: The project failed to compile with this version of the engine. Would you like to open the project in Visual Studio?), but when new class is added, it is always needed to set them again and again…

The Hot Reload problem is mentioned here, it is impossible for me currently, after a long compilation it always ends with a message: Error LINK : fatal error LNK1181: cannot open input file ‘delayimp.lib’.

Is there any solution for it? Thanks.

Ivan

Hey sivan,

Could you also please report which of these registry keys you have, and what the associated InstallDir is:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\WDExpress\12.0
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WDExpress\12.0

And also the InstallationFolder from these keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1

And finally all of the above but under HKEY_CURRENT_USER instead.

This is where we look for Visual C++ installations, and Visual C++ is responsible for setting up the SDK paths. I give the same advice here: Can't load C++ projects - Programming & Scripting - Unreal Engine Forums

… as it sounds like a related problem, but I haven’t had a response there yet.

Steve

Hi,

I had the same missing mspdb120.dll problem before swithced to VS2013Comm, probably caused by VS2010Pro or WinSDK-s I uninstalled before installing VS2013Comm.


HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0 :

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\

HKEY_CURRENT_USER…

this registry path does not exist


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0

found no installdir here, only some scrpath under Setup…

HKEY_CURRENT_USER…

no installdir here, only in 12.0_Config:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\

similar registry folders/keys exist here for 10.0 and 10.0_Config


HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\WDExpress\12.0

no installdir regkey here

HKEY_CURRENT_USER…

this registry path does not exist


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WDExpress\12.0

this registry path does not exist

HKEY_CURRENT_USER…

no installdir here, only in 12.0_Config:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\


HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1

C:\Program Files (x86)\Windows Kits\8.1\

but I have several other winsdk-s here under Windows, all with InstallationFolder, except v7.1: v7.1, v7.1A, v8.0, v8.0A, v8.1, v8.1A (I uninstalled VS2010, VS2013EE, and earlier winsdks when installed VS2013 community)

HKEY_CURRENT_USER…

this registry path does not exist


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\

here I have also v7.1, v7.1A, v8.0A, v8.1A but v7.1 and v8.0A without installation folder key

HKEY_CURRENT_USER…

this registry path does not exist

Hi again sivan,

This looks ok to me. The problem as I see it is that UBT is not picking up the Visual Studio environment variables for some reason. Could you open a command window, go to:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64

… and then run:

vcvarsx86_amd64.bat

… followed by:

set | clip

… and then paste the result here?

I’m trying to establish if there is something in your environment variables that UBT is failing to process for some reason. The LIB variable should include an entry for a path like:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\amd64

… which is where the delayinp.lib file lives.

Steve

hi,

I get nothing when running it from a command prompt (I used Developer Command Prompt for VS2013). if I run it from Total Commander, only a blank command-prompt-like window appears for a second.

where should I get the LIB variable? it is not among the Environmental Variables, like PATH.

Ivan

Sorry, I should have made it clear that ‘set | clip’ will put the output of the set command into the clipboard for you, instead of the console window. You should literally be able to paste the output directly, without copying. Remove the ‘| clip’ if you want to see the output for yourself.

The LIB variable (and others) should be set by vcvarsx86_amd64.bat.

Steve

hi Steve, sorry no success, my clipboard is not changed by it.
Regards,

Ivan

Well, that’s interesting. Even running ‘set’ on its own in a command line produces nothing?

Steve

exactly. I also tried by making a .bat (but similar result), containing:

call “C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat” set

Could you try copying the following into a new file called info.bat and running it, please? It should dump some information about your setup into a file called info.txt. After that, please attach the file here.

Thanks!

Steve

@echo off
set LOGFILE=%CD%\info.txt
set VS120COMNTOOLS >%LOGFILE%

echo. >>%LOGFILE%
echo ****** 32-bit toolchain: ****** >>%LOGFILE%
echo. >>%LOGFILE%

pushd %VS120COMNTOOLS% >>%LOGFILE%
setlocal
dir >>%LOGFILE%
call vsvars32.bat >>%LOGFILE%
echo. >>%LOGFILE%
echo PATH=%PATH% >>%LOGFILE%
echo. >>%LOGFILE%
echo INCLUDE=%INCLUDE% >>%LOGFILE%
echo. >>%LOGFILE%
echo LIB=%LIB% >>%LOGFILE% 
endlocal
popd

echo. >>%LOGFILE%
echo ****** x86-amd64 toolchain: ****** >>%LOGFILE%
echo. >>%LOGFILE%

pushd %VS120COMNTOOLS%..\..\VC\bin\x86_amd64 >>%LOGFILE%
setlocal
dir >>%LOGFILE%
call vcvarsx86_amd64.bat >>%LOGFILE%
echo. >>%LOGFILE%
echo PATH=%PATH% >>%LOGFILE%
echo. >>%LOGFILE%
echo INCLUDE=%INCLUDE% >>%LOGFILE%
echo. >>%LOGFILE%
echo LIB=%LIB% >>%LOGFILE% 
endlocal
popd

Hi, done, the file is here (my Windows is Hungarian)

Have you replaced cmd.exe with PowerShell, or any other shell replacement?

Steve

no, I don’t even know how to do that :slight_smile: maybe an installed software could do it?

I’ve made a change to how the environment variables are harvested which doesn’t rely on ‘set’. You say you are running the engine from source, so you should be able to get the following three changes:

https://github.com/EpicGames/UnrealEngine/commit/a80f7b84c443b4a0db748fbd56ca84369d1d940d

https://github.com/EpicGames/UnrealEngine/commit/d44fd8bfe30edbfdcdd0d421db7d862b749ccc8d

https://github.com/EpicGames/UnrealEngine/commit/6f79ebe1e1a87ebcfaabbdefe3599ffabfe5f04f

Build the new EnvVarsToXML.exe from the specified project, and then rebuild UnrealBuildTool with the changes made to Utils.cs. Then please report back whether or not this fixes your problem.

Steve

I need a little more time, as yesterday I had problems. First downloaded a clean 4.7.3, made EnvVarsToXML.exe, changed Utils.cs but then UE4.sln was not possible to generate, then got the original Utils.cs from GitHub, but UE4 compilation failed. Today I make a new trial with a clean engine compiled first, then applying everything else afterwards.

Please also get this latest change which should fix EnvVarsToXML.exe compilation for GitHub users:

https://github.com/EpicGames/UnrealEngine/commit/0aea4571125f61da51ef9770a79a18ce691c2c86

Steve

hi,

I made the changes, built EnvVarsToXML.exe again, but building UnrealBuildTool fails with:

Error 1 The namespace ‘UnrealBuildTool’ already contains a definition for ‘MasterProjectFolder’ C:\UE4\UE473mod\Engine\Source\Programs\UnrealBuildTool\System\VCProjectFileGenerator.cs 17
Error 2 The namespace ‘UnrealBuildTool’ already contains a definition for ‘ProjectFileGenerator’ C:\UE4\UE473mod\Engine\Source\Programs\UnrealBuildTool\System\VCProjectFileGenerator.cs 104
Error 3 The namespace ‘UnrealBuildTool’ already contains a definition for ‘ProjectFileComparer’ C:\UE4\UE473mod\Engine\Source\Programs\UnrealBuildTool\System\VCProjectFileGenerator.cs 2261
Warning 4 The referenced component ‘EnvVarsToXML’ could not be found.

or should I rebuild the whole engine again?

That sounds like a bad sync to me, like you’ve got two copies of VCProjectFileGenerator.cs or something. The missing EnvVarsToXML seems odd too, like it’s a different instance of UnrealBuildTool, or one of the two .vsproj files are not where they are supposed to be.

Please recheck your changes and project layout.

Steve

hmm… I copied back my backupő files corresponding to UnrealBuildTool, compiled fine, made the changes again (from scratch), now I get this error:

Error 1 ‘UnrealBuildTool.MSBuildProjectFile’ does not contain a definition for ‘ShouldBuildByDefaultForSolutionTargets’ and no extension method ‘ShouldBuildByDefaultForSolutionTargets’ accepting a first argument of type ‘UnrealBuildTool.MSBuildProjectFile’ could be found (are you missing a using directive or an assembly reference?) C:\UE4\UE473mod\Engine\Source\Programs\UnrealBuildTool\System\VCProjectFileGenerator.cs 660
Error 2 ‘UnrealBuildTool.VCSharpProjectFile’ does not contain a definition for ‘ShouldBuildByDefaultForSolutionTargets’ and no extension method ‘ShouldBuildByDefaultForSolutionTargets’ accepting a first argument of type ‘UnrealBuildTool.VCSharpProjectFile’ could be found (are you missing a using directive or an assembly reference?) C:\UE4\UE473mod\Engine\Source\Programs\UnrealBuildTool\System\ProjectFileGenerator.cs 1201
Warning 3 The referenced component ‘EnvVarsToXML’ could not be found.

Hi Steve Robb,

I applied are your stated changes as well and built the EnvVarsToXML successfully. However, when rebuilding UBT I get the errors:

2>------ Rebuild All started: Project: UnrealBuildTool, Configuration: Development Any CPU ------
2>D:\UE4\Engine\Source\Programs\UnrealBuildTool\System\ProjectFileGenerator.cs(1201,25,1201,63): error CS1061: 'UnrealBuildTool.VCSharpProjectFile' does not contain a definition for 'ShouldBuildByDefaultForSolutionTargets' and no extension method 'ShouldBuildByDefaultForSolutionTargets' accepting a first argument of type 'UnrealBuildTool.VCSharpProjectFile' could be found (are you missing a using directive or an assembly reference?)
2>D:\UE4\Engine\Source\Programs\UnrealBuildTool\System\VCProjectFileGenerator.cs(660,89,660,127): error CS1061: 'UnrealBuildTool.MSBuildProjectFile' does not contain a definition for 'ShouldBuildByDefaultForSolutionTargets' and no extension method 'ShouldBuildByDefaultForSolutionTargets' accepting a first argument of type 'UnrealBuildTool.MSBuildProjectFile' could be found (are you missing a using directive or an assembly reference?)
========== Rebuild All: 0 succeeded, 1 failed, 1 skipped ==========