# UFUNCTION specifier Within=OuterClassName causes compile failure

**URL:** <https://forums.unrealengine.com/t/ufunction-specifier-within-outerclassname-causes-compile-failure/450672>\
**Category:** C++\
**Tags:** error-compile, ufunction, unreal-engine, question, CPP\
**Created:** [June 14, 2019, 10:56am UTC](https://forums.unrealengine.com/t/ufunction-specifier-within-outerclassname-causes-compile-failure/450672 "2019-06-14T10:56:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LonelySnake](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LonelySnake](https://forums.unrealengine.com/u/LonelySnake)\
**Post date:** [June 14, 2019, 10:56am UTC](https://forums.unrealengine.com/t/ufunction-specifier-within-outerclassname-causes-compile-failure/450672/1 "2019-06-14T10:56:32Z")

</div>

I currenctly working on a something like uc state for my Character class.

```
UCLASS(DefaultToInstanced, EditInlineNew, CustomConstructor, Within=AGameCharacterBase)
class GAME_API UPawnStateBase: public UStateBase
{
//some code
}

```

Just like the UUTWeaponState in the UT project

But when I build the project there’s always an error:

```
Within class 'AGameCharacterBase' not found

```

I tried forward declaration, inculding more related headers, but the error remains still.

What do I miss?

---

<div class="post-metadata">

**Author:** ![LonelySnake](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LonelySnake](https://forums.unrealengine.com/u/LonelySnake)\
**Post date:** [June 17, 2019, 3:15am UTC](https://forums.unrealengine.com/t/ufunction-specifier-within-outerclassname-causes-compile-failure/450672/2 "2019-06-17T03:15:58Z")

</div>

Figured it out my self.

the Within specifier must be filled with FILENAME without extension， not the CLASSNAME that start with an A(for Actor) or U(for UOBject)

Hope this discovery could help the others someday

---

<div class="post-metadata">

**Author:** ![Eigendrea](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Eigendrea](https://forums.unrealengine.com/u/Eigendrea)\
**Post date:** [March 29, 2021, 9:46am UTC](https://forums.unrealengine.com/t/ufunction-specifier-within-outerclassname-causes-compile-failure/450672/3 "2021-03-29T09:46:52Z")

</div>

It certainly helped me. Thanks man!
