Error LNK2001 unresolved external symbol when extending FoliageType class in C++

Hello everyone,

I’ve been looking through the existing posts dealing with this kind of issues (Link errors and dependencies) but I didn’t find something about the specific issue i’m facing.

I extended the FoliageType class in C++ and just at the creation of the class, I get this compile error :

error LNK2001: unresolved external symbol “public: virtual void __cdecl UFoliageType::Serialize(class FArchive &)” (?Serialize@UFoliageType@@UEAAXAEAVFArchive@@@Z)

and the same for 4 other functions. The thing is, in my dependencies, I already added Foliage :

PublicDependencyModuleNames.AddRange(new string[] { […SomeOtherDependencies…], "Foliage" });

Which is the solution everyone talks about when experiencing a Link error when extending a class in UE4.

Has someone already experienced extending FoliageType in C++ ? I would need some help here, I can’t go further in my procedural generation if I can’t set up this class.

Thanks for your time, really appreciated.
Have a nice day

Hi @Nazruden, did you find a solution to this problem? I’m stuck with it today.

I think it’s all about the MinimalAPI meta tag, which is in the UCLASS settings of the UFoliageType_InstancedStaticMesh class.