# Clion - Windows - UE4.20.2 Problem

**URL:** <https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165>\
**Category:** Platform & Builds\
**Tags:** ide, build, unreal-engine, question, CPP\
**Created:** [September 4, 2018, 4:37pm UTC](https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165 "2018-09-04T16:37:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarklinkFighter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DarklinkFighter](https://forums.unrealengine.com/u/DarklinkFighter)\
**Post date:** [September 4, 2018, 4:37pm UTC](https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165/1 "2018-09-04T16:37:31Z")

</div>

Hi,

some time ago I got Clion IDE working on Windows with an Unreal Engine Project.  
I tried it again with Engine Version 4.20.2 because I red that the Plugin was now integrated into the official UE Repository…

But now I have some problems with it…

1. I activated the Built-In Plugin and selected Clion as Standart IDE in the Editor Preferences.
2. I installed all required MinGW Stuff through msys2
3. I configured CLion for MinGW
4. Clicked on Generate CMakeList File in UE4
5. Clicked on Open CLion in UE4
6. CLion tried loading the Project… Failed because of path backslashes instead of slashes…
7. Manualy fixed it to slashes…
8. Now I got this…

 ![252704-clion-ue4-problem.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/e/e/aee4d5a4f3d3ff354b4c031a5ca06e3997939f56.png)

![252706-clion-settings.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/0/340dcadf4e2bcf039e30f1e0d1177b8eb2fee8f8.png)

So Building the Project in Clion does work…  
But the Coding Features does not because Clion seems to link the Unreal cpp files but not the Header files…

 ![252705-clion-ue4-cpp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/7/9/079b75ab36d2d1fd94a702ab5665daa38c234c95.png)

Does someone have the same issue and / or knows how to fix this?

---

<div class="post-metadata">

**Author:** ![TheDreamCatcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thedreamcatcher/32/727178_2.png) [@TheDreamCatcher](https://forums.unrealengine.com/u/TheDreamCatcher)\
**Post date:** [September 4, 2018, 5:27pm UTC](https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165/2 "2018-09-04T17:27:14Z")

</div>

the cpp files you see are part of the engine, not of your game. you actually don’t need them. in fact you can edit the CMakeLists.txt et comment out the

`include("Path/To/cmake-headers-ue4.cmake")`

`include("Path/To/cmake-sources-engine.cmake")`

`include("Path/To/cmake-csharp-engine.cmake")`

UBT is set for clang-5 which can cause errors with gcc, mingw should provide the clang packages up to clang-6

---

<div class="post-metadata">

**Author:** ![DarklinkFighter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DarklinkFighter](https://forums.unrealengine.com/u/DarklinkFighter)\
**Post date:** [September 4, 2018, 5:37pm UTC](https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165/3 "2018-09-04T17:37:48Z")

</div>

Thank you for the answer 🙂  
Yeah as I said the build does work indeed…  
But the important IDE features like “Find Usages” does not work and I thought it’s related to the missing external (engine) header files… Because he does not add them to the project…  
And in the past (with Engine Version 4.17 or something like that I got this as well working with the plugin)

---

<div class="post-metadata">

**Author:** ![TheDreamCatcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thedreamcatcher/32/727178_2.png) [@TheDreamCatcher](https://forums.unrealengine.com/u/TheDreamCatcher)\
**Post date:** [September 4, 2018, 5:43pm UTC](https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165/4 "2018-09-04T17:43:22Z")

</div>

there was a bug introduced in 4.20 that failed to include the proper generated headers in the cmake-includes.cmake. check if the `Intermediate/Build/Linux/B4D820EA/UE4Editor/Inc/ProjectName` is properly added to the list of folders.

---

<div class="post-metadata">

**Author:** ![DarklinkFighter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DarklinkFighter](https://forums.unrealengine.com/u/DarklinkFighter)\
**Post date:** [September 4, 2018, 5:57pm UTC](https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165/5 "2018-09-04T17:57:52Z")

</div>

Seems to be there if it is `/Intermediate/Build/Win64/UE4Editor/Inc/TankOfTanks` in the Case of Windows…  
At least this is the last include\_directory inside that file…

---

<div class="post-metadata">

**Author:** ![TheDreamCatcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thedreamcatcher/32/727178_2.png) [@TheDreamCatcher](https://forums.unrealengine.com/u/TheDreamCatcher)\
**Post date:** [September 4, 2018, 8:20pm UTC](https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165/6 "2018-09-04T20:20:38Z")

</div>

in CLion’s Settings you should set C Compiler and C++ Compiler to clang. you will need to insall them with msys2.exe ( `pacman -Ss clang` to find the packages then `pacman -S mgroup/package-name` ) most errors should then go away

---

<div class="post-metadata">

**Author:** ![TheDreamCatcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thedreamcatcher/32/727178_2.png) [@TheDreamCatcher](https://forums.unrealengine.com/u/TheDreamCatcher)\
**Post date:** [September 4, 2018, 9:53pm UTC](https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165/7 "2018-09-04T21:53:33Z")

</div>

one thing is to noticed, you will need to edit the cmake-definitions.cmake as it has a bug there:

find -DPROJECT\_COPYRIGHT\_STRING= and put what follows between double quote or it will raise an error

---

<div class="post-metadata">

**Author:** ![DarklinkFighter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DarklinkFighter](https://forums.unrealengine.com/u/DarklinkFighter)\
**Post date:** [September 5, 2018, 4:47pm UTC](https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165/8 "2018-09-05T16:47:31Z")

</div>

Yes that worked!  
Thank you very much now it finds the Header Files and the IDE Features work as expected 🙂  
I tried using the Visual Studio Toolchain within CLion (which is currently only a early access feature) but it seems to work this way and it’s using cl.exe

---

<div class="post-metadata">

**Author:** ![TheDreamCatcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thedreamcatcher/32/727178_2.png) [@TheDreamCatcher](https://forums.unrealengine.com/u/TheDreamCatcher)\
**Post date:** [September 11, 2018, 10:38am UTC](https://forums.unrealengine.com/t/clion-windows-ue4-20-2-problem/433165/9 "2018-09-11T10:38:09Z")

</div>

There is an other solution that also gets rid of any errors inside the code:

go to CLion ` Settings > Build,Execustion,Deployment -> Toolchain` and there change the settings from MonGW to `VisualStudio`. Change `Architecture` to be `amd64` and set `Make`, `C Compiler` and `C++ Compiler` to `Let CMake Detect` then Apply. In the `CMake` section change `Build type:` to `Release`. Apply and close settings and everything should work as expected.
