Unable to find 'class', 'delegate', 'enum', or 'struct' with name 'TSharedPtr'

Hello, as per the title, I was getting this error when attempting to create a function, which calls another function from a base class.
The base function is as follows

It’s from the replay subsystem. I wanted to have all the same parameters in my function as in the original, but the compiler doesn’t like TSharedPtr at all. I was trying to make it a UFUNCTION, to make it blueprint callable. So is this why?
I tried adding the include of TSharedPtr, and attempted forward declaring as well. No luck. Any help is appreciated!

hi @ojimenez40

I dont personally know the answer but this post maye help you.

1 Like

I see thanks for the quick reply! I think this gave me a lead. It could be the variable’s type that was the issue - IAnalyticsProvider. I’ll see if something works later on.

TSharedPtr is not supported with the blueprint system. It is not a UCLASS and it is templated.

/**
 * TSharedPtr is a non-intrusive reference-counted authoritative object pointer.  This shared pointer
 * will be conditionally thread-safe when the optional Mode template argument is set to ThreadSafe.
 */
template< class ObjectType, ESPMode InMode >
class TSharedPtr

EDIT Actually, I see the same thing on TSoftObjectPtr but I know for sure that can be a UPROPERTY, unsure how exactly that is processed. With Blueprint exposed systems (UFUNCTION, UPROPERTY) your options are a b it limited. You can still use various pointer types. The UObject*, SoftObjectPtr, SoftClassPtr etc. but I know for sure that adding a TSharedPtr as a UPROPERTY is not going to compile.

6 Likes

That’s interesting, thanks for the response! Maybe if I’d like to mirror what that base class does, I’ll have to use one of those other pointers. Then convert it within the function into TSharedPtr if necessary. Like in my other reply, IAnalyticsProvider also doesn’t seem BP friendly, so that’s another issue lol.