3

I use Unreal Engine 5.1.1 with Visual Studio 2022 and all the time I compile a code, even a script from a template project, or a new, just created empty script - I get an error in Visual Studio:

Error MSB3073 The command ""C:\Program Files\Epic Games\UE_5.1\Engine\Build\BatchFiles\Build.bat" MyProjectEditor Win64 Development -Project="C:\Users\lord_\Documents\Unreal Projects\MyProject\MyProject.uproject" -WaitMutex -FromMsBuild" exited with code 6

I haven't tried anything so far, besides creating a new Unreal project, since I am a very noob and just getting familiarised with the engine and C++

2
  • The best way to know what error code 6 means would be to look at the build.bat file and see under what situations it returns that code. Commented Mar 22, 2023 at 21:04
  • Terminology side note: C++ is a compiled language. C++ source files are not "scripts". Commented Aug 4, 2023 at 10:43

5 Answers 5

7

Don't open unreal engine with the desktop icon. Load the visual studio 2022 project which the engine build by default and then ctrl+f5 to build the solution. Then unreal engine will boot automatically. This error comes when unreal engine 5 is already opened in the background with visual studio. I guess this code is simply made to boot the engine. I wasted a lot of time on this to figure out the solution, and it was this silly lol.

Sign up to request clarification or add additional context in comments.

Comments

2

Resolution: either close the editor before compiling or disable Live Coding in the Editor Preferences.

Comments

0

I was having a similar issue. There are requirements in Visual Studio to work with Unreal. But also make sure to have the Visual Studio integration Tool installed from Epic Games.

Comments

0

You can check the output window within Visual Studio for more information.

After building my game and getting this error, my output window told me to install .NET framework. To do this, start the Visual Studio Installer -> Modify > Select '.NET Desktop Development' -> Install

After install, try to rebuild again

Comments

0

The issue may not be always the synchronisation with the generated sln project and the intermidiate folder from the uproject file, or some VS configurations or so.

The highly likely reason: Instead the issue may lie within your code. A mere coding bug simply.

The solution: For instance, I made a mistake intentially by commenting "USTRUCT()" while keeping "GENERATED_BODY()" within the struct definition, which is illegal from the UE coding standard stand point:

StructMsgArchisim.h
//USTRUCT() (line 64)
struct FDS_ARCHISIM_CONTROL {
    GENERATED_BODY()
    INT32 statusAndCounterAndLength;//CONVERT32
    float emitterTime; // REAL32
    double xRef, yRef; // REAL64
};

The errors window on VS showed the following, which doesn't mention this USTRUCT error whatsoever: (screenshot) https://ibb.co/JRTjQQh

The best approach in this case to identify the error is to check the log file located at

C:\Users\<userName>\AppData\Local\UnrealBuildTool\log.txt

There, I found the following warning, which points directly to the reason behind the command failure:

...
Running Internal UnrealHeaderTool D:\SaadEssahliDesk\UE-PseudoArchisim\Archive\UE-Archisim_1Client1APC\Visualisation_a_UE4272_1Client1APC\SIMU.uproject D:\SaadEssahliDesk\UE-PseudoArchisim\Archive\UE-Archisim_1Client1APC\Visualisation_a_UE4272_1Client1APC\Intermediate\Build\Win64\SIMUEditor\Development\SIMUEditor.uhtmanifest -WarningsAsErrors -installed
D:\SaadEssahliDesk\UE-PseudoArchisim\Archive\UE-Archisim_1Client1APC\Visualisation_a_UE4272_1Client1APC\Source\SIMU\StructMsgArchisim.h(64): Warning: The identifier 'GENERATED_BODY' was detected in a block being skipped. Was this intentional?
Total of 0 written
Total execution time: 8.03 seconds
...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.