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

**URL:** <https://forums.unrealengine.com/t/error-lnk2001-unresolved-external-symbol-when-extending-foliagetype-class-in-c/445710>\
**Category:** World Creation\
**Tags:** error, dependencies, foliage-type, linker-error, unreal-engine, CPP, question\
**Created:** [March 21, 2019, 11:21am UTC](https://forums.unrealengine.com/t/error-lnk2001-unresolved-external-symbol-when-extending-foliagetype-class-in-c/445710 "2019-03-21T11:21:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nazruden](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nazruden](https://forums.unrealengine.com/u/Nazruden)\
**Post date:** [March 21, 2019, 11:21am UTC](https://forums.unrealengine.com/t/error-lnk2001-unresolved-external-symbol-when-extending-foliagetype-class-in-c/445710/1 "2019-03-21T11:21:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![niddle](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@niddle](https://forums.unrealengine.com/u/niddle)\
**Post date:** [September 19, 2023, 3:00pm UTC](https://forums.unrealengine.com/t/error-lnk2001-unresolved-external-symbol-when-extending-foliagetype-class-in-c/445710/2 "2023-09-19T15:00:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![niddle](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@niddle](https://forums.unrealengine.com/u/niddle)\
**Post date:** [September 19, 2023, 3:02pm UTC](https://forums.unrealengine.com/t/error-lnk2001-unresolved-external-symbol-when-extending-foliagetype-class-in-c/445710/3 "2023-09-19T15:02:38Z")

</div>

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