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. 

Adding Unreal Interface Does Not Compile

When I an Unreal interface with the engine, I get the following compilation errors. I've also included the code that is generated by Unreal.

PickupInterface.h(11): error C2504: 'UInterface': base class undefined

PickupInterface.h(12): error C3646: 'Super': unknown override specifier

PickupInterface.h(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

PickupInterface.h(12): error C2614: 'UPickupInterface': illegal member initialization: 'Super' is not a base or member

PickupInterface.h(12): error C2440: 'return': cannot convert from 'UPickupInterface ' to 'UObject '

PickupInterface.h(12): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

 #pragma once
 
 #include "CoreMinimal.h"
 #include "PickupInterface.generated.h"
 
 // This class does not need to be modified.
 UINTERFACE(MinimalAPI)
 class UPickupInterface : public UInterface
 {
     GENERATED_BODY()
 };
 
 /**
  * 
  */
 class TOMBWORLD_API IPickupInterface
 {
     GENERATED_BODY()
 
     // Add interface functions to this class. This is the class that will be inherited to implement this interface.
 public:
     
     
 };
Product Version: UE 4.18
Tags:
more ▼

asked Mar 08 '18 at 04:59 PM in C++ Programming

avatar image

Cabewz
60 2 5 6

avatar image Atheist91 Mar 08 '18 at 08:50 PM

Hey there.

Have you tried including Interface.h?

 #include "UObject/Interface.h"

From what I see, it's not directly included in CoreMinimal.h. It might be somewhere deeper tho.

avatar image Cabewz Mar 08 '18 at 09:25 PM

I am incredibly confused. I added the Interface header, and it still failed. I added core minimal, same thing. Swapped the order and it worked. Then I removed both and it still compiles. I have no idea why, there is nothing else I changed. Thanks for the help, I do wish I knew what the issue was though.

avatar image Atheist91 Mar 08 '18 at 09:29 PM

It seemed kind of odd that you had this error in the first place. I can't remember if I ever had to include this header explicitly anywhere in my code actually. Maybe forcing VS to actually recompile your stuff fixed the issue. That's actually quite common solution. :P

avatar image killowatt Mar 20 '18 at 07:13 PM

I am not sure if I am experiencing the same thing but in a different form, but it maybe has to do with in what order you include the Interface header file, as it compiled fine until I moved the #include for the interface in my other classes to right before the .generated.h file. Not sure though

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

0 answers: sort voted first
Be the first one to answer this question
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