Unreal Engine: Clion cant find or create definitions.

Answered

For every class or struct created with the Unreal Engine, actualy every class with a prefix, CLion refuses to find the defintions of any method or constructor and marking them "not implemented". I cant even create via Alt+Enter, the lookup for existing definitions just takes hours (i just gave it 2h when i was afk) or fails.
Inspections and auto completions seems also not to work in these source files, although the headers are included.
The source and header files have ofc the same names, just like UE4 creates them, the project files are updated and the cmake project is reloaded. I also tried invalidating cache etc. Im also using the Unreal Engine Plugin for Clion.
I hope someone know how to fix this, its realy annoying.

0
8 comments

Hello!

Do you use CLion on Windows?

0
Avatar
Permanently deleted user

Yes, Windows 10 Home Edition.
Btw i tried create definition again in the meanwhile, within a minute the memory usage went up to 8gb (from 5.5gb) which is the maximum i set. I had to invalidate chace and restart, its now at 4gb but stadily increasing with 100% cpu usage when power save mode is disabled.

0

Hi Tobias,

Do you have your project build? Especially if you already have the Unreal Header Build tool run on your project (as it generates lots of files/headers via the reflection mechanism). W/o these .generated.h headers CLion might not be able to parse the code correctly.

Also, I guess RPC might be marked as not implemented because the UE4 RPC implementation functions have specific names, different from the definition's name.

CLion, in general, is not aware of many UE4 specifics, it just deals with UE4 project as with a general C++ one. This might not be enough. We plan to target the UE4 development with Rider, which is currently C# and Unity IDE. The functionality is gonna be similar to what ReSharper C++ currently suggests: https://www.jetbrains.com/resharper-cpp/features/#Unreal_Engine. If you are interested in Private Preview, please let me know which email address I have to use to subscribe you to the Private Preview. Mind, for now, it's Windows only.

0
Avatar
Permanently deleted user

Yes, the project builds and Changes are hot-loaded in the editior.
The UE Editor also runs the header tool when creating a class. I also refreshed the Cmake project, reloaded it in clion, restartet clion and even invalidate cache/reindex without any changes in the project.

Its not just the Unreal functions, if i create a function, lets say ApplyManaRegen, which i actually have declared it fails to define them and when i create a definition CLion cant find it. It doesent matter if its a class method or a free function, it fails in all cases. It also doesnt matter if i use UFUNCTION or i dont.

The File Names also dont seem to matter. If i rename the Files from OwningPlayerState to UOwningPlayerState (which is simply derived from UClass) it doesnt work either (but ofc it fails to compile, the header tools complains about the missing prefix).

Initial i thought its because the prefix, but i had a simmiliar problem a while ago. Some source files werent recognised as source files (despite the fact it were .cpp files and ofc in the CMakelists).

Im not using RPCs atm, so i cant say if Clion finds them. But Clion seems to find all other things from the Engine, just not my Files.

It seems i simply cant afford Rider or even Resharper, 

0
Avatar
Permanently deleted user

Oh, i was looking at the Company Prices.
I'd be glad to try it out and if "the funtionality is similar to reshaper" means it got rid of cmake im in. You can use my profile email address, its the same i use for Clion.

0

I also encountered the same problem and hope to experience the Private Preview for Windows if I have a chance. Thank you!

my email: [deleted, please check the link of public review below]

0

That's awesome! Thank you!

0

Please sign in to leave a comment.