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

**URL:** <https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795>\
**Category:** Multiplayer & Networking\
**Tags:** error, unreal-engine, Multiplayer, shooter, question, CPP\
**Created:** [December 31, 2015, 11:18am UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795 "2015-12-31T11:18:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 11:18am UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/1 "2015-12-31T11:18:03Z")

</div>

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.

 ![72399-screenshot_25.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/0/5d0167bbb8a0fb21f3996ce85384234d071be624.png)

---

<div class="post-metadata">

**Author:** ![Daekesh](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daekesh/32/918652_2.png) [@Daekesh](https://forums.unrealengine.com/u/Daekesh)\
**Post date:** [December 31, 2015, 12:58pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/2 "2015-12-31T12:58:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 4:51pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/3 "2015-12-31T16:51:35Z")

</div>

where do I compile in Visual Studio?

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 4:58pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/4 "2015-12-31T16:58:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [December 31, 2015, 5:13pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/5 "2015-12-31T17:13:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 5:29pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/6 "2015-12-31T17:29:24Z")

</div>

Can’t see any Build option

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 5:34pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/7 "2015-12-31T17:34:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Daekesh](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daekesh/32/918652_2.png) [@Daekesh](https://forums.unrealengine.com/u/Daekesh)\
**Post date:** [December 31, 2015, 5:45pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/8 "2015-12-31T17:45:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 6:35pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/9 "2015-12-31T18:35:56Z")

</div>

opening the file with Visual Studio via windows explorer

---

<div class="post-metadata">

**Author:** ![Daekesh](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daekesh/32/918652_2.png) [@Daekesh](https://forums.unrealengine.com/u/Daekesh)\
**Post date:** [December 31, 2015, 6:38pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/10 "2015-12-31T18:38:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 6:40pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/11 "2015-12-31T18:40:25Z")

</div>

ehmmm…

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 6:41pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/12 "2015-12-31T18:41:03Z")

</div>

where is the solution file?

---

<div class="post-metadata">

**Author:** ![Daekesh](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daekesh/32/918652_2.png) [@Daekesh](https://forums.unrealengine.com/u/Daekesh)\
**Post date:** [December 31, 2015, 6:48pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/13 "2015-12-31T18:48:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 7:11pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/14 "2015-12-31T19:11:00Z")

</div>

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

 ![72461-screenshot_26.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/6/f/16f7eac2c34b00d3d8068b9acb94d2a8bea7a101.png)

---

<div class="post-metadata">

**Author:** ![Daekesh](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daekesh/32/918652_2.png) [@Daekesh](https://forums.unrealengine.com/u/Daekesh)\
**Post date:** [December 31, 2015, 7:15pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/15 "2015-12-31T19:15:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 7:16pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/16 "2015-12-31T19:16:31Z")

</div>

1 succeeded, 1 failed

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [December 31, 2015, 7:45pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/17 "2015-12-31T19:45:39Z")

</div>

But its the same

---

<div class="post-metadata">

**Author:** ![Daekesh](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daekesh/32/918652_2.png) [@Daekesh](https://forums.unrealengine.com/u/Daekesh)\
**Post date:** [December 31, 2015, 7:46pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/18 "2015-12-31T19:46:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iKiWY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iKiWY](https://forums.unrealengine.com/u/iKiWY)\
**Post date:** [January 1, 2016, 9:30pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/19 "2016-01-01T21:30:52Z")

</div>

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 ==========

---

<div class="post-metadata">

**Author:** ![Daekesh](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daekesh/32/918652_2.png) [@Daekesh](https://forums.unrealengine.com/u/Daekesh)\
**Post date:** [January 1, 2016, 9:35pm UTC](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795/20 "2016-01-01T21:35:04Z")

</div>

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

Go fix.

[Next page](https://forums.unrealengine.com/t/c-compile-error-couldnt-find-target-rules-file-for-target/342795.md?page=2)
