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:
};
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.
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.
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
I have the same problem and was working 2 days on it being confused. My code was the same as the example and it just wouldn’t work. But somehow, switching some property orders or moving the #import made me able to compile? I have no idea what the problem is but hopefully the #import is the answer and it’ll work from now on.