Weird error when building with VS 2015

I created an empty C++ project. In it I created an empty C++ class (MyClass.cpp) using the editor. The class didn’t show up in the content browser. Someone on IRC suggested to close the editor and build the project from VS - I’m using VS Community 2015.

After closing the editor and building from VS I got this message:

1>------ Build started: Project: TestProject, Configuration: Development_Editor x64 ------
1>  The system cannot find the path specified.
1>  Creating makefile for hot reloading TestProjectEditor (game project files are newer)
1>  Compiling game modules for hot reload
1>  Target is up to date.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command ""D:\Library\Programs\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" TestProjectEditor Win64 Development "D:\Library\Projects\UE4\TestProject\TestProject.uproject" -rocket -waitmutex -2015" exited with code 1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

A solution rebuild gave this output:

1>------ Rebuild All started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Rebuild All started: Project: TestProject, Configuration: Development_Editor x64 ------
2>  The system cannot find the path specified.
1>  The system cannot find the path specified.
2>  Cleaning TestProjectEditor Binaries...
2>  The system cannot find the path specified.
2>  Creating makefile for TestProjectEditor (no existing makefile)
2>  Performing full C++ include scan (no include cache file)
2>  Parsing headers for TestProjectEditor
2>    Running UnrealHeaderTool "D:\Library\Projects\UE4\TestProject\TestProject.uproject" "D:\Library\Projects\UE4\TestProject\Intermediate\Build\Win64\TestProjectEditor\Development\UnrealHeaderTool.manifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -rocket -installed
2>  Reflection code generated for TestProjectEditor in 10.480795 seconds
2>  Performing 9 actions (4 in parallel)
2>  [3/9] Resource ModuleVersionResource.rc.inl
2>  [2/9] Resource PCLaunch.rc
2>  PCH.TestProject.h.cpp
2>  TestProjectGameMode.cpp
2>  MyClass.cpp
2>  TestProject.cpp
2>  TestClass.cpp
2>  TestProject.generated.cpp
2>  [9/9] Link UE4Editor-TestProject.dll
2>     Creating library D:\Library\Projects\UE4\TestProject\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-TestProject.lib and object D:\Library\Projects\UE4\TestProject\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-TestProject.exp
2>  -------- End Detailed Actions Stats -----------------------------------------------------------
2>  Total build time: 84.30 seconds
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(42,5): error MSB3073: The command ""D:\Library\Programs\Epic Games\4.10\Engine\Build\BatchFiles\Rebuild.bat" TestProjectEditor Win64 Development "D:\Library\Projects\UE4\TestProject\TestProject.uproject" -rocket -waitmutex -2015" exited with code 1.
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

The weird thing is that only empty classes don’t show up in content browser, is it mandatory that they are marked as UCLASS()?

As for the build errors, I haven’t found any information as to what’s the cause and how to fix it, can anyone shed some light on this?

Hi tehyosh,

You are correct that classes that do not contain the UCLASS macro will not be visible within the Editor. This is because without that macro, the Unreal Header Tool and Unreal Build Tool cannot “see” the classes, so they are essentially invisible to the Editor. You can certainly use a “standard” C++ class like this if you wish, but be aware that you will need to be extra careful with it to make sure anything that needs to have access to it can actually see it.

I was unable to reproduce the build error that you described. Did you manually move any file/folder related to the project at any time after it was created? Are you able to build other code projects successfully?

The compile bug happens all the time, even if I just create an empty project, open VS and build. Compiling inside the editor causes no problems, it happens only in VS. Both the editor and VS are being ran with administrator rights.

It’s not a huge problem as I compile only from the editor but I’m thinking this might cause problems further down the road if I ever need to compile from VS.

Does it have any importance that VS & UE4 are on separate disks?

Hi tehyosh,

Sorry for taking so long to get back to you. Are you still seeing the build error in Visual Studio? If so, could you please provide the exact steps that you are following from creating a new code project to when this error occurs in Visual Studio?

With regards to your question about Visual Studio and UE4 being installed on separate disks, that shouldn’t be a problem. I have Visual Studio installed on my C: drive, and all of my versions of UE4 are installed on the D: drive.

Well, I’m not seeing the error as I’m compiling from the editor, not building from VS anymore.

I’m making creating the project by selecting new blank C++ project, setting the path and name (usually D:\Project\UE4) and clicking “create project”. Afterwards I just start VS 2015 by double clicking the solution name.
The error appears without making any changes to the initially created project.

One thing I forgot to mention is that VS 2015 was installed initially by Unity3D as part of the Unity “bundle”. After I installed UE4 I modified the VS installation (via control panel) to include the necessary C++ packages but I don’t think that would constitute a problem as I was able to compile and run projects from the editor, just not from VS.

I have still had no luck when trying to reproduce the build error that you described. Could you please download this file to your desktop? Remove the .txt extension from the end of the file, then run the batch file. It will create a new file named info.txt that contains information about your Visual Studio installation. If you could please upload that here, it may help me determine what is going wrong.

I’ve attached the info file. One strange thing I noticed in it was that it makes reference to c:\Program Files (x86)\Microsoft Visual Studio 12.0\ directory. The VS that I’m using is located in c:\Program Files (x86)\Microsoft Visual Studio 14.0\

And now I feel like an idiot. I sent you the VS 2013 file instead of the VS 2015 file. I apologize for that. This is the correct file.

Hey , here’s the new file.

One thing I noticed was that when I ran the script the window that popped up said “The system cannot find the path specified.”, that message appeared in the build logs as well. Problem is, I have no idea what path it’s trying to access and why.

Sorry for the delay again. I have a followup question for you. Are you using source control with your project? I was able to turn up an older post that referenced the same error code, and it turned out that was being caused by Perforce interfering with files that needed to be writable.

For the project that initially gave me the error I was using git. But afterwards it happened in an empty project without any source control.

Hi tehyosh,

I have asked a few different engineers here to look over the issue you are experiencing, and so far no one has been able to guess at what file path is not being found. Do you get the same messages if you run Build.bat or Clean.bat from a command window?

One possible solution to consider would be re-installing Visual Studio. That is normally not something I would suggest unless all other options have been exhausted, but in this case it may be worth trying since we cannot determine what the actual cause of the issue may be.

Hey ,

I’m not really sure where those Build.bat and Clean.bat are so I can run them from command window. I’ll try reinstalling VS and UnrealEngine and come back with the result.

Hi tehyosh,

We have not heard back from you for a few days. Did re-installing Visual Studio help? I will be marking this post as resolved for internal tracking purposes, but please feel free to add a comment and re-open the post if you need any additional help.

Hi , sorry about the late reply, work caught up with me. Unfortunately reinstalling VS and UE didn’t fix the problem. On top of that I found that if I want to cook the content for Windows I get some errors as well :frowning: Log is here, as it’s too long to paste in the comment box: LogPlatformFile: Not using cached read wrapperLogInit:Display: RandInit(-24059 - Pastebin.com

Is there any that having Unity 5 installed on the same machine might cause the problems? Or that UE4 is not installed in C:\Program Files? Right now it’s installed in a custom directory on D: drive.
I really wanna switch from Unity to UE but right now the only solution I’m left with is either installing it in a VM or reinstalling my OS :frowning:

There should be no problem with UE4 not being installed on the C: drive. On my computer, I have UE4 on the D: drive with Visual Studio installed on the C: drive and haven’t run into any problems with that setup. There also should not be any problems caused by having both UE4 and Unity 5 installed simultaneously.

Unfortunately we are still somewhat stumped by the original issue. We have not been able to determine what path Visual Studio is looking for here, or why it is unable to find it. Just on a hunch, when you reinstalled Visual Studio, did you make sure to install the C++ files? I believe VS 2015 does not include these by default.

Yep, I did install C++. Here’s my current setup, is anything missing? http://i.imgur.com/ZVpaYxk.png

I have the same issue. Please help!

Error MSB3073 The command ““C:\Program Files (x86)\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat” SLV Win64 Development “D:\Projects\UnrealHospital\sources\SLV_Template\SLV.uproject” -rocket -waitmutex -2015” exited with code -1. SLV C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37

Hi Anton,

Sorry for the delay in getting back to you. If you are still having trouble with this, could you please provide the full output you receive?

Hi Everyone,

We have continued attempting to reproduce this periodically, and so far have been unable to do so. Unfortunately without further information to help us try to identify what is happening here, we will be unable to provide any additional support on this issue.

At this point the only suggestions we have would be to try re-installing Visual Studio, and possibly Unreal Engine as well, again. Also, double-check to make sure the appropriate Windows SDK’s are installed correctly.