dotBunny / CLionSourceCodeAccess

A CLion Plugin for Unreal Engine
136 stars 26 forks source link

Fixed header include order to satisfy Unreal Engine 4.17 source code formatting. #76

Closed fbuether closed 6 years ago

fbuether commented 7 years ago

See Issue #75: Unreal Engine 4.17 complains that the header file corresponding to a source file needs to be the first include.

reapazor commented 7 years ago

I'm not sure about this --- we keep changing header orders. Can someone else confirm?

reapazor commented 6 years ago

This didn't appear to be needed by anyone else, so this seems to be a one off aberration. As the plugin moves to master inclusion, it changes much of this and will be built into the engine.

edowson commented 6 years ago

I ran into the same issue while building for UE 4.18.1 on CentOS-7.4.1708.

Applying the patch helped resolve the error related to the ordering of the header files with UE-4.18.1, but a bunch of new errors now appear:

CLionSourceCodeAccessModule.h:23:27: error: field type 'FCLionSourceCodeAccessor' is an abstract class
        FCLionSourceCodeAccessor CLionSourceCodeAccessor;

CLionSourceCodeAccessModule.cpp:13:1: error: cannot initialize return object of type 'IModuleInterface *' with an rvalue of type
      'FCLionSourceCodeAccessModule *'
IMPLEMENT_MODULE(FCLionSourceCodeAccessModule, CLionSourceCodeAccess);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CLionSourceCodeAccessor.cpp:206:68: error: no member named 'Type' in 'FFileHelper::EEncodingOptions'
Alexandertyler-zz commented 6 years ago

This has been fixed for 4.19. 4.18 is not supported due to unreal dropping command line codelite support.

edowson commented 6 years ago

I'm trying to build the CLionSourceCodeAccess plugin, not the CodeLiteSourceCodeAccess plugin.

UE-4.19 hasn't been released yet. I decided to try out the master branch to get the latest changes, but the error still persists. These are the errors that I get with a fresh build on CentOS-7.4 with clang-5.0.1:

CLionSettings.cpp(1): error: Expected CLionSettings.h to be first header included.
CLionSourceCodeAccessModule.cpp(1): error: Expected CLionSourceCodeAccessModule.h to be first header included.
/CLionSourceCodeAccessor.cpp(1): error: Expected CLionSourceCodeAccessor.h to be first header included.

After re-ordering the headers, I get a new set of errors:

CLionSourceCodeAccessModule.h:23:27: error: field type 'FCLionSourceCodeAccessor' is an abstract class
CLionSourceCodeAccessModule.cpp:13:1: error: cannot initialize return object of type 'IModuleInterface *' with an rvalue of type
      'FCLionSourceCodeAccessModule *
CLionSourceCodeAccessor.cpp:206:68: error: no member named 'Type' in 'FFileHelper::EEncodingOptions'
CLionSourceCodeAccessor.cpp:239:69: error: no member named 'Type' in 'FFileHelper::EEncodingOptions'
CLionSourceCodeAccessor.cpp:263:68: error: no member named 'Type' in 'FFileHelper::EEncodingOptions'
CLionSourceCodeAccessor.cpp:356:69: error: no member named 'Type' in 'FFileHelper::EEncodingOptions'
CLionSourceCodeAccessor.cpp:380:68: error: no member named 'Type' in 'FFileHelper::EEncodingOptions'

ERROR: UBT ERROR: Failed to produce item: Engine/Plugins/Developer/CLionSourceCodeAccess/Binaries/Linux/libUE4Editor-CLionSourceCodeAccess.so

Perhaps this issue could be re-opened to fix it?

fbuether commented 6 years ago

@edowson I managed to get the plugin running with 4.18 by applying (parts of) commit ced3a27f5ce6b3a59204d74c3884521026301829; however, I have customized a bit of the cmake generation process anyways, as I had a couple of issues with hot reload, so it might actually be best to steer clear of 4.17.

edowson commented 6 years ago

@fbuether thanks, I just tried building it using the 4.18 branch of the CLionSourceCodeAccess repo and the UE repo's 4.18 branch (which at the time of writing is at release version 4.18.2).

It still complains about header file ordering in the *.cpp file:

CLionSettings.cpp(1): error: Expected CLionSettings.h to be first header included.
CLionSourceCodeAccessModule.cpp(1): error: Expected CLionSourceCodeAccessModule.h to be first header included.
CLionSourceCodeAccessor.cpp(1): error: Expected CLionSourceCodeAccessor.h to be first header included.
ERROR: Build canceled.

This can be easily fixed by changing the order of the header files as indicated in the error message and using the patch that you had developed earlier. The patch that you created earlier to fix this issue has not yet made it to this repo, because the pull request was not accepted earlier.

@Alexandertyler Given that we now have a fix for building CLionSourceCodeAccess for UE-4.18.2, would you mind re-opening this issue, and accepting fbuether's pull request for the header file re-ordering for the 4.18 branch of this repo?

At the moment, the UE4 Editor 4.18.2 launches correctly, I can see it load CLionSourceCodeAccess in the terminal logs, but when I try to create a new C++ project, it still shows the error that no compiler was found and to install NullSourceCodeAccessor.

Is there something else that I should do to get UE4 Editor to register the CLionSourceCodeAccess plugin?

reapazor commented 6 years ago

Whats the PR specifically you want accepted?

The plugin has been merged into the master branch of UE at this point (my original PR for that was https://github.com/EpicGames/UnrealEngine/pull/4142), the team at Epic has updated it a bit :)

edowson commented 6 years ago

@reapazor It is the PR referenced in this thread:https://github.com/dotBunny/CLionSourceCodeAccess/pull/76

I guess it was closed because it was thought to be a one off issue. I checked out the CLionSourceCodeAccess 4.18 branch, and had to manually apply the header re-ordering patch, in order to get it to compile.

edowson commented 6 years ago

@reapzaor Any idea when this PR https://github.com/EpicGames/UnrealEngine/pull/4142 will get merged into UE4? I'd very much like to start using CLion 2017.3 with UE-4.18 or 4.19.