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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Overriding regular cpp function (no UFUNCTION) with warns C4263 & C4264

Hi :)

Parent class:

 UCLASS(Blueprintable, BlueprintType)
 class R3_API USObject : public UObject
 {
     GENERATED_BODY()
 
 public:
     virtual void Init();
 }

Child class:

 UCLASS(Blueprintable, BlueprintType)
 class R3_API USOrder : public USObject
 {
     GENERATED_BODY()
 
 public:
     void Init(int32 Iterations );
 }


Visual Studio 2015 on Windows 7:

 SOrder.h(16): warning C4263: 'void USOrder::Init(int32)': member function does not override any base class virtual member function
 
 SOrder.h(41): warning C4264: 'void USObject::Init(void)': no override available for virtual member function from base 'USObject'; function is hidden
 
 SObject.h(17): note: see declaration of 'USObject::Init'
 
 Object.h(8): note: see declaration of 'USObject'

Also same warning is treating as error on OS X El Capitan via XCode/clang. Please, help me understand what is the right way to make same named function in Child class with different signature. Thank you :)

Product Version: UE 4.10
Tags:
more ▼

asked Feb 11 '16 at 03:17 PM in C++ Programming

avatar image

gamescodedogs
190 4 14 21

avatar image ArcainOne Feb 11 '16 at 05:56 PM

Now this is interesting indeed. You would think that the compiler would see these as two separate functions. At first I thought it would have been the case missing virtual function but the function signatures are completely different which should mean an overloaded function. Since they are not UFUNCTIONS you would think that the Unreal Build Tool (UBT) would not worry about it either...

My Test would be to Remove the UCLASS (and R3_API) and see if you still get this error. If you do NOT it's the UBT and a bug, if you do... then its something with the C++ compiler itself and something we are both missing...

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

1 answer: sort voted first

Thank you, it's c++ feature :)

 class UMyObject
 {
 public:
     virtual void Init(int32 val1){};
 };
 
 
 class UMyObjectChild : public UMyObject
 {
 public:
     void Init(int32 val1, int32 val2){};
 };
 
 MyObjectChild.h(16): warning C4263: 'void UMyObjectChild::Init(int32,int32)': member function does not override any base class virtual member function
 MyObjectChild.h(18): warning C4264: 'void UMyObject::Init(int32)': no override available for virtual member function from base 'UMyObject'; function is hidden
 MyObject.h(17): note: see declaration of 'UMyObject::Init'
 MyObject.h(13): note: see declaration of 'UMyObject'

more ▼

answered Feb 12 '16 at 01:15 PM

avatar image

gamescodedogs
190 4 14 21

(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