C++ Compile Error "Couldn't find target rules file for target"

Hi!
For every 5 minutes spent on adding a feature, it always takes 10 hours to fix the errors, but today it’s different.
I made a new map and added the code to C++ ShooterMainMenu.cpp for it to show up in menus, but when I try to compile the code in UE4, I get this error (Image). Tied removing the code I added and I still get the same error.
Can anybody help me? The project is a Shooter Game template.

Try deleting your binaries and intermediate\build folders. Oh, and never compile in the editor.

Hey -

Compiling in Visual Studio can be done by right-clicking on the name of the project in the solution solution explorer and selecting Build. When doing this, you want to ensure that your solution configuration and solution platform as set to Development Editor and Win64 respectively.

Cheers

where do I compile in Visual Studio?

deleted them both and now im getting an error when starting up that the project could not be compiled

Can’t see any Build option

I’m opening the .cpp in windows explorer because it doesn’t show up in UE content browser if that makes any difference

Do you have the project open in Visual Studio? Or are you right clicking in the editor/windows explorer?

opening the file with Visual Studio via windows explorer

You’re opening the solution file, not the .cpp file, yes?

ehmmm…

where is the solution file?

If you don’t have a .sln file (yourproject.sln) then right click the uproject and choose ‘regenerate project files’ or something. It has ‘generate’ in there somewhere.

thank you got it :smiley:
After Building the solution I get this errors in ShooterMainMenu.cpp

Use the output window, not the errors window, to get build errors.

1 succeeded, 1 failed

It will tell you why it failed, copy+paste the entire log.

But its the same

1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Build started: Project: Gamma, Configuration: Development_Editor x64 ------
2> Performing full C++ include scan (hot reloading a new target)
2> Compiling game modules for hot reload
2> Performing 3 actions (4 in parallel)
2> [1/3] Link UE4Editor-ShooterGameLoadingScreen-9084.dll
2> Module.ShooterGame.cpp
2> Creating library C:\Users\KiWY\Documents\Unreal Projects\Gamma\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-ShooterGameLoadingScreen-9084.lib and object C:\Users\KiWY\Documents\Unreal Projects\Gamma\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-ShooterGameLoadingScreen-9084.exp
2>C:\Users\KiWY\Documents\Unreal Projects\Gamma\Source\ShooterGame\Private\UI\ShooterHUD.cpp(53): error C2100: illegal indirection
2> -------- End Detailed Actions Stats -----------------------------------------------------------
2>ERROR : UBT error : Failed to produce item: C:\Users\KiWY\Documents\Unreal Projects\Gamma\Binaries\Win64\UE4Editor-ShooterGame-2722.dll
2> Total build time: 284,73 seconds
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command ““C:\Program Files\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat” ShooterGameEditor Win64 Development “C:\Users\KiWY\Documents\Unreal Projects\Gamma\Gamma.uproject” -rocket -waitmutex” exited with code -1.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

2>C:\Users\KiWY\Documents\Unreal Projects\Gamma\Source\ShooterGame\Private\UI\ShooterHUD.cpp(53): error C2100: illegal indirection

Go fix.