C4458 under VS2015

Hello fellow programmers.

I’ve managed to generate project files under VS2015 but during compilation of the engine there’s the error C4458 “Declaration of foo hides class members”. I’ve never actually got this error before and MSDN does not say anything useful. Is there some way to get around this error perhaps with some specific project setting? Thanks

#pragma warning(disable: 4458)

I get this warning about my character.cpp in vs when building (clean and build ue4.13)

C4458: declaration of 'InputComponent' hides class member
22>  G:\Code\GitHub\UE4_Preview\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(316): note: see declaration of 'AActor::InputComponent'

Does disabling the warning fix anything or does it just not display the warning?

The editor, packaged game and dedicated server all work.

I do get this error in the dedicated server log every once and a while…

[2016.08.31-01.36.31:792][ 92]LogOutputDevice:Error: === Handled ensure: ===
[2016.08.31-01.36.31:797][ 92]LogOutputDevice:Error: 
[2016.08.31-01.36.31:798][ 92]LogOutputDevice:Error: Ensure condition failed: !Velocity.ContainsNaN() [File:G:\Code\GitHub\UE4_Preview\Engine\Source\Runtime\Engine\Private\Components\CharacterMovementComponent.cpp] [Line: 4256]
[2016.08.31-01.36.31:799][ 92]LogOutputDevice:Error: PhysWalking: Velocity contains NaN after CalcVelocity (/Game/Sarlack/Levels/01_Level01.01_Level01:PersistentLevel.SC_Soldier_C_0.CharMoveComp)
[2016.08.31-01.36.31:799][ 92]LogOutputDevice:Error: X=-nan(ind) Y=-nan(ind) Z=0.000
[2016.08.31-01.36.31:800][ 92]LogOutputDevice:Error: Stack: 
[2016.08.31-01.36.31:801][ 92]LogOutputDevice:Error: SarlackServer.exe
[2016.08.31-01.36.31:801][ 92]LogOutputDevice:Error: SarlackServer.exe
[2016.08.31-01.36.31:802][ 92]LogOutputDevice:Error: SarlackServer.exe

I am getting the same InputComponent warning. Found any solution?

Hello DamirH I just experienced the bug where I was receiving the input component warning listed above. I am uncertain on how to replicate it but I have an idea on how it happened, and a possible solution.

My circumstances are the following I couldn’t compile my game code changes due to a bug with my precompiled headers, to fix what ever had gone wrong with my precompiled headers I decided to clean and rebuild the solution (Engine and Game).

I cleaned and rebuilt the solution. It rebuilt successfully but I had a bug in my code. I fixed the bug and ran the editor. When ever I attempted to hot reload compile I was getting the InputComponent warning, despite being 100% sure there was no fault with my InputComponent.

I believe that building the solution while there was an error within my code caused this warning to exist.I don’t know why it caused this but it is worth noting that the bug I was fixing was within a function I was binding to an input event within the InputComponent.

What I then did after that was right click my UE4 module and cleaned and built it separately.

Then built my game module separately as well.

Then when I launched my game and hot recompiled, I didn’t see the error any more.

I hope this helps.

The warning occurs because the method parameter has the same name as a (parent) class member.

You can get rid of it by renaming the method parameter, e.g. to inputComponent (with lowercase i).

But (assuming the method that causes the warning is SetupPlayerInputComponent) it shouldn’t matter, since the input component handed to the method is identical to the class member (see APawn::PawnClientRestart()). Because of that, it’s also irrelevant if you use InputComponent or inputComponent (or whatever name you chose for the method paramter) inside SetupPlayerInputComponent - but it might be better to use the method parameter, just in case something changes in later engine versions …

mindw0rm is correct in the case of SetupPlayerInputComponent and I renamed mine to “InputComp” :wink: Thanks!

You can disable that warning, and then re-enable it:

#pragma warning(push)
#pragma warning(disable: 4458)
void AYourClass::SetupPlayerInputComponent(class UInputComponent* InputComponent)
{
	Super::SetupPlayerInputComponent(InputComponent);
}
#pragma warning(pop)

The following helped me:
I just wrote "virtual void SetupPlayerInputComponent(class UInputComponent* NewInputComponent); "
Namely NEW InputComponent