x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: Not Selected
Tags:
more ▼

asked Aug 13 '15 at 09:17 PM in C++ Programming

avatar image

Dynko
56 2 2 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

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 ...

more ▼

answered Sep 21 '16 at 07:37 AM

avatar image

mindw0rm
36 16 8

avatar image 3D Masons Oct 06 '16 at 07:29 AM

mindw0rm is correct in the case of SetupPlayerInputComponent and I renamed mine to "InputComp" ;) Thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

pragma warning(disable: 4458)

more ▼

answered Aug 13 '15 at 09:36 PM

avatar image

Dynko
56 2 2 12

avatar image Sarlack Aug 31 '16 at 02:52 AM

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

avatar image DamirH Sep 15 '16 at 08:51 AM

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

avatar image Jakey113G Sep 18 '16 at 02:05 AM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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)
more ▼

answered May 04 '17 at 12:06 PM

avatar image

SlimyDeath
6 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question