I created a class UTemp that derives from UObject like this (Temp.h):
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "Temp.generated.h"
UCLASS()
class CPROJECT_API UTemp : public UObject
{
GENERATED_BODY()
public:
UTemp();
};
Temp.cpp:
#include "Temp.h"
UTemp::UTemp() {
}
So far, so simple. I can create objects of this class without a problem but when I try to assign them I get the following error:
UTemp temp1;
UTemp temp2 = temp1;
Error C2248 'UTemp::UTemp': cannot access private member declared in class 'UTemp'
(It said something about not being able to “access the operator=” earlier but something changed and now I get this. Unfortunately I can’t remember what I did.)
I have classes inheriting AActor in this project that I can use without any problems.
Only UObject is causing those errors
It seems like there’s a problem with accessing the (private?) copy constructors of UObject