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…
- I activated the Built-In Plugin and selected Clion as Standart IDE in the Editor Preferences.
- I installed all required MinGW Stuff through msys2
- I configured CLion for MinGW
- Clicked on Generate CMakeList File in UE4
- Clicked on Open CLion in UE4
- CLion tried loading the Project… Failed because of path backslashes instead of slashes…
- Manualy fixed it to slashes…
- Now I got this…
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…
Does someone have the same issue and / or knows how to fix this?
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
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)
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.
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…
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
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
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
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.