'Z_Param_Stimulus' use struct 'FAIStimulus' undefined

Hi,
I’m trying to conver my Blueprint to pure C++ and i’m getting a problem with that; i’m following this blog as a guide and the next is my code:

#pragma once

#include "CoreMinimal.h"
#include "AIController.h"
#include "On3DAIController.generated.h"

/**
 * 
 */
UCLASS()
class ON3DFILTERTEST_API AOn3DAIController : public AAIController
{
	GENERATED_BODY()

public:

	void BeginPlay() override;

	UFUNCTION(BlueprintCallable, Category = "Blackboard")
	void UpdateBlackboardEnemyKey(AActor* Actor, FAIStimulus Stimulus);

protected:

	UPROPERTY(VisibleAnywhere, Category = "AI")
	UAIPerceptionComponent* AIPerception;

	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Blackboard")
	UBlackboardComponent* BlackboardComponent;
	
	UPROPERTY(EditDefaultsOnly, Category = "Blackboard")
	UBlackboardData* BlackboardDataToUse;
	
	UPROPERTY(EditDefaultsOnly, Category = "Blackboard")
	UBehaviorTree* BehaviorTreeToUse;
	
};

Unfortunately, when I try to compile it get the next error:

CompilerResultsLog: Error: D:\Programas\Desarrollo\Epic Games\Projects\On3DFilterTest\Source\On3DFilterTest/On3DAIController.h(15) : error C2079: 'Z_Param_Stimulus' utiliza struct 'FAIStimulus' sin definir
CompilerResultsLog: Error: D:\Programas\Desarrollo\Epic Games\Projects\On3DFilterTest\Source\On3DFilterTest/On3DAIController.h(15) : error C2664: 'void AOn3DAIController::UpdateBlackboardEnemyKey(AActor *,FAIStimulus)': el argumento 2 no puede convertirse de 'int' a 'FAIStimulus'
CompilerResultsLog: D:\Programas\Desarrollo\Epic Games\Projects\On3DFilterTest\Source\On3DFilterTest/On3DAIController.h(15): note: Uso del tipo no definido 'FAIStimulus'
CompilerResultsLog: d:\programas\desarrollo\epic games\projects\on3dfiltertest\intermediate\build\win64\ue4editor\inc\on3dfiltertest\On3DAIController.generated.h(12): note: vea la declaraci?n de 'FAIStimulus'
CompilerResultsLog: Error: D:\Programas\Desarrollo\Epic Games\Projects\On3DFilterTest\Intermediate\Build\Win64\UE4Editor\Inc\On3DFilterTest\On3DAIController.gen.cpp(41) : error C2079: 'Z_Construct_UFunction_AOn3DAIController_UpdateBlackboardEnemyKey_Statics::On3DAIController_eventUpdateBlackboardEnemyKey_Parms::Stimulus' utiliza struct 'FAIStimulus' sin defi
nir
CompilerResultsLog: Error executing D:\Programas\Engines\UE_4.24\Engine\Build\Windows\cl-filter\cl-filter.exe (tool returned code: 2)

But I don’t get where is the error, i made all in the same way.

Can anyone help me?

Thanks.

We need the definition of that type included in the header as we’re specifying it as a parameter.
As we are using FAIStimulus as a parameter, we have to include its header:
Going to the documentation(looking in Google), we get that we need to add #include "Perception/AIPerceptionTypes.h" in the header in order to include the parameter’s type.

As another example we have FName for the next function:

UFUNCTION(BlueprintCallable, Category = Behaviour)
void MakeDamage(ACharacter* Actor, FName SocketName);

This function have the structure FName as a input parameter, so, we need to include its respective parameter: looking at documentation(Google again), we get that we have to add #include "UObject/NameTypes.h" to our header file in order to avoid errors.