Expected a '>', and other errors

I’m experiencing some problems with my header file crashing headfirst.

  • DECLARE_DELEGATE_OneParam throws me this error: *Expected a ‘>’
  • DECLARE_DELEGATE_OneParam gives me a warning: Function definition for ‘DECLARE_DELEGATE’ not found.
  • If I remove my attempt to create a delegate the UCLASS() throws an error: This declaration has no storage class or type specifier

I’m unaware of where to look if this is a continuation of an earlier fault in the project. I have not edited the related SOAPGOAPCharacter files, nor any of the others that I see being included…

The headerfile in its entirety:

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameFramework/PlayerController.h"
#include "SOAPGOAPPlayerController.generated.h"

DECLARE_DELEGATE_OneParam(MoveTo, FVector DestLocation);
/**

**/
UCLASS()
class ASOAPGOAPPlayerController : public APlayerController
{
	GENERATED_BODY()

public:
	ASOAPGOAPPlayerController();

protected:
	/** True if the controlled character should navigate to the mouse cursor. */
	uint32 bMoveToMouseCursor : 1;

	// Begin PlayerController interface
	virtual void PlayerTick(float DeltaTime) override;
	virtual void SetupInputComponent() override;
	// End PlayerController interface

	/** Resets HMD orientation in VR. */
	void OnResetVR();

	/** Navigate player to the current mouse cursor location. */
	void MoveToMouseCursor();

	/** Navigate player to the current touch location. */
	void MoveToTouchLocation(const ETouchIndex::Type FingerIndex, const FVector Location);
	
	/** Navigate player to the given world location. */
	void SetNewMoveDestination(const FVector DestLocation);

	/** Input handlers for SetDestination action. */
	void OnSetDestinationPressed();
	void OnSetDestinationReleased();

	//Commandeering agents
	ACharacter* PlayerDrivenAgent;
	void Select();

	MoveTo SetDestination(FVector DestLocation);
};

You don’t need to provide the parameter name to DECLARE_DELEGATE_OneParam. Line 6 should just be DECLARE_DELEGATE_OneParam(MoveTo, FVector);

I’m not sure about your “UCLASS() declaration has no storage class or type specifier” issue, but your

DECLARE_DELEGATE_OneParam(MoveTo, FVector DestLocation);

should just be

DECLARE_DELEGATE_OneParam(MoveTo, FVector);

If you want to specifically name the parameter, you can use:

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(MoveTo, FVector, DestLocation);

I’m not completely certain what’s functionally different between these two methods, but I use the last method for event delegates I work with via blueprints.

That did it. Thanks!

Although I still curiously have a Function definition for ‘DECLARE_DELEGATE’ not found. Though it doesn’t seem to have any apparent effect beyond being a nuisance.