How to solve entire classes being marked with "red errors" with UE4 code?

Look at screenshots below , this how the entire engine's code looks fro me.

Also, my own code is often full of such false negatives until I add additional include like to class header.

#include "Components/ActorComponent.h"

Using this header directly is redundant, already included in other headers I use there. But Resharper doesn't seem to analyze it, requiring putting extra includes in my classes to fix highlighting false errors...

Did I set up something incorrectly?

 

 

0
19 comments
Avatar
Permanently deleted user

Hello,

Which versions of UE and R++ are you using?

Could you please run R++ in internal mode (by starting VS with the /ReSharper.Internal command-line arg: devenv.exe /ReSharper.Internal), open the file with red includes, then run "ReSharper | Internal | C++ | Dump inclusion context" and attach the resulting log?

Thanks!

0

I use UE 4.24 and recent R++ 2020.1.

Can't attach a text file, so just dumping it here. I hope it's fine :)

Inclusion context:
C:\Repo\Unreal\Engine\Source\Editor\ComponentVisualizers\Private\ComponentVisualizers.cpp
Base project: ProjectImpl(Name : UE4)
Base project file: ProjectFileImpl(Path : ComponentVisualizers.cpp)
Include paths:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\INCLUDE
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.2\include\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt
Defines:
#define _MSVC_LANG(0:0)
#define _WIN32(0:0)
#define _ATL_VER(0:0)
#define MFC_VER(0:0)
#define _MSC_BUILD(0:0)
#define _MSC_EXTENSIONS(0:0)
#define _MSC_FULL_VER(0:0)
#define _MSC_VER(0:0)
#define _NATIVE_WCHAR_T_DEFINED(0:0)
#define _WCHAR_T_DEFINED(0:0)
#define _CPPUNWIND(0:0)
#define _DLL(0:0)
#define _MT(0:0)
#define _M_AMD64(0:0)
#define _M_X64(0:0)
#define _WIN64(0:0)
#define _NATIVE_NULLPTR_SUPPORTED(0:0)
#define _RVALUE_REFERENCES_SUPPORTED(0:0)
#define _RVALUE_REFERENCES_V2_SUPPORTED(0:0)
#define _INTEGRAL_MAX_BITS(0:0)
#define __RSCPP_VERSION(0:0)
#define __RESHARPER__(0:0)
#define __cplusplus(0:0)
#define __STDCPP_DEFAULT_NEW_ALIGNMENT__(0:0)
#define __cpp_aggregate_nsdmi(0:0)
#define __cpp_alias_templates(0:0)
#define __cpp_aligned_new(0:0)
#define __cpp_attributes(0:0)
#define __cpp_binary_literals(0:0)
#define __cpp_capture_star_this(0:0)
#define __cpp_conditional_explicit(0:0)
#define __cpp_constexpr(0:0)
#define __cpp_decltype(0:0)
#define __cpp_decltype_auto(0:0)
#define __cpp_delegating_constructors(0:0)
#define __cpp_enumerator_attributes(0:0)
#define __cpp_exceptions(0:0)
#define __cpp_fold_expressions(0:0)
#define __cpp_generic_lambdas(0:0)
#define __cpp_inheriting_constructors(0:0)
#define __cpp_init_captures(0:0)
#define __cpp_initializer_lists(0:0)
#define __cpp_lambdas(0:0)
#define __cpp_namespace_attributes(0:0)
#define __cpp_nontype_template_args(0:0)
#define __cpp_nontype_template_parameter_auto(0:0)
#define __cpp_nsdmi(0:0)
#define __cpp_range_based_for(0:0)
#define __cpp_raw_strings(0:0)
#define __cpp_ref_qualifiers(0:0)
#define __cpp_return_type_deduction(0:0)
#define __cpp_rtti(0:0)
#define __cpp_rvalue_references(0:0)
#define __cpp_sized_deallocation(0:0)
#define __cpp_static_assert(0:0)
#define __cpp_template_auto(0:0)
#define __cpp_template_template_args(0:0)
#define __cpp_unicode_characters(0:0)
#define __cpp_unicode_literals(0:0)
#define __cpp_user_defined_literals(0:0)
#define __cpp_variable_templates(0:0)
#define __cpp_variadic_templates(0:0)
#define __cpp_variadic_using(0:0)
Compilation properties:
LanguageKind: Cpp
IncludePaths:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\INCLUDE
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.2\include\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt
PredefinedMacros:
UndefinedMacros:
ForcedIncludes:
Toolset: V141
LanguageStandard: Unspecified
TargetMachine: AMD64
DefaultCallingConvention: CDecl
DisableLanguageExtensions: False
HasBasicRuntimeChecks: False
OmitDefaultLibName: False
TreatWChar_tAsBuiltInType: True
DefaultCharIsUnsigned: False
HasRuntimeTypeInfo: False
HasExceptionHandling: True
IsDebug: False
IsDll: True
IsAndroid: False
IsClangOrGcc: False
ForceIncludePch: False
ProcessPredefinedMacros: True
UsePrecompiledHeader: None
PrecompiledHeaderThrough:
PrecompiledHeaderFile:
IgnorePrecompiledHeaderOptions: False
ExcludedFromBuild: False
CPlusPlusDefineFromLanguageStandard: False
HasCoroutines: False
ConformanceMode: False
ClrSupport: ManagedNotSet
Language dialect:
LanguageKind: Cpp
BuiltinWchar: True
BuiltinChar1632: True
SizeTUnderlyingType: UNSIGNED_LONGLONG
DefaultCallingConvention: CDECL
DefaultMemberCallingConvention: CDECL
LambdaCallingConventions: CDECL_VECTORCALL
HasMsMakeIntegerSeq: True
HasCpp14AutoWithListInitFix: True
HasImplicitConstOnConstexprMemberFunctions: False
IgnoreStdFastAndThiscall: True
HasNullPtr: True
HasNoexcept: True
AllowsUserDefinedLiterals: True
HasExplicitConversionOperators: True
HasDelegatingConstructors: True
HasNestedNamespaces: False
HasDefaultedAndDeletedFunctions: True
AutoBehavior: TYPE_DEDUCTION
HasOverride: True
HasExportKeyword: True
HasIfInitializers: False
HasRangeForInitializers: False
HasInlineVariables: False
HasConstexprIf: False
HasGuaranteedCopyElision: False
HasCoroutines: False
HasAggregatesWithBaseClasses: False
HasCTAD: False
HasStructuredBindings: False
HasConcepts: False
VariableDeclarationRulesAreC89Compatible: False
PreferCopyCtorOverUserDefined: False
HasAlternativeOperators: False
HasThreeWayComparison: False
HasStringBuiltins: False
HasDefaultConstructibleAndAssignableStatelessLambdas: False
ProhibitAggregatesWithUserDeclaredConstructors: False
HasConsteval: False
HasCpp20StructuredBindings: False
HasChar8: False
SizeOfPointer: 8
RequiresParameterNameInFunctionDefinition: False
HasCpp11StyleAttributes: True
SupportsGnuStyleAttributes: False
HasBuiltinUnreachable: False
HasConstinit: False
HasAggregateParenInit: False
HasUsingEnum: False
HasCpp20Attributes: False
HasNodiscard: False
AllowBindingRValueToLValueReference: True
HasFamiliarTemplateSyntaxForGenericLambdas: False
Processed symbol tables:
C:\Repo\Unreal\Engine\Source\Editor\ComponentVisualizers\Private\ComponentVisualizers.cpp
Processed symbol tables:
C:\Repo\Unreal\Engine\Source\Editor\ComponentVisualizers\Private\ComponentVisualizers.cpp

 

0
Avatar
Permanently deleted user

Thanks, looks like R++ does not have the include paths to UE sources. Could you please also run  "ReSharper | Internal | Project Model | Dump project model" and attach the result as a file to https://youtrack.jetbrains.com/issue/RSCPP-30229?

What kind of solution is this? Are you opening UE from the github repo or is it a game created in Unreal Editor?

0

Opening up from game solution, engine compiled from the GitHub source with literally few modifications.

Is there a way to share the project model privately? ;)

 

0
Avatar
Permanently deleted user

Yes, when attaching to https://youtrack.jetbrains.com/issue/RSCPP-30229 set "Visible to" to "jetbrains-team" or "ReSharper C++ team".

1

Ok, you got me surprised here :)

Dump attached :)

0
Avatar
Permanently deleted user

Sorry, I don't see the attachment. What visibility did you set? Could you please try setting it to jetbrains-team?

0

Mhm, weird... Is it fine now? Set to "Resharper C++ team" ;)

0
Avatar
Permanently deleted user

No, sorry, not sure what's up with that. Could you please try changing it to "dotnet-developers"? It's a group of people working on R#, so should be narrow enough.

0
Avatar
Permanently deleted user

Sorry, still not sure what's going on - I don't see any issue updates at all. That's how the issue looks on my machine, could you please show your version? Or just send me the dump directly to igor.akhmetov at jetbrains.com.

0

Weird thing. Re-uploaded and set it like this. I don't need to write a comment to make it work, right?

0
Avatar
Permanently deleted user

I think you're adding an attachment to the comment itself, so you have to add some text in this case. Alternatively you can click on the "Click to attach" message under the title to just attach a file. I agree, it's a bit counter-intuitive.

0

Oh :D

You should have it now, then :)

0
Avatar
Permanently deleted user

Yes, thanks! We'll investigate.

0

I am having the same problem. Did you solve it?

0
Avatar
Permanently deleted user

Mesothere If it's a new file, make sure to "Refresh Visual Studio project" from Unreal Editor. Otherwise this should be fixed in 2020.2, please try a preview build when it's out in a couple of weeks.

1

Mesothere

Well, I just apply workaround from the thread on UE4 forum since it was caused by UE 4.24 bug in GitHub-based source builds ;)
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1503170-solved-intellisense-cannot-find-source-files-in-new-untouched-project/page2

 

0

"Refresh Visual Studio project" from UE4 worked for me - Thanks !

0

Please sign in to leave a comment.