Using BlueprintPure causes compile error [Resolved]

I am trying to make a blueprint function that does not have the target input like BlueprintCallable does. Thus I am using BlueprintPure instead, but it can’t compile for some reason.

Edit: Just to be clear, BlueprintCallable does compile but “BlueprintCallable, BlueprintPure” cause a compile error and so does just BlueprintPure.

.h

#pragma once

#include "GameFramework/Actor.h"
#include "HitTester.generated.h"

UCLASS()
class HITORIENTATION_API AHitTester : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AHitTester();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;


	UFUNCTION(BlueprintCallable, BlueprintPure, Category = testCat)
		void CallTest(FVector testinput);
	
};

.cpp

#include "HitOrientation.h"
#include "HitTester.h"


// Sets default values
AHitTester::AHitTester()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

}

// Called when the game starts or when spawned
void AHitTester::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void AHitTester::Tick( float DeltaTime )
{
	Super::Tick( DeltaTime );

}


void AHitTester::CallTest(FVector testinput)
{
	UE_LOG(LogTemp, Warning, TEXT("Called?! %s"), *testinput.ToString());
}

Errors

Severity	Code	Description	Project	File	Line
Error	code	OtherCompilationError (5)	HitOrientation	D:\Unreal Projects\HitOrientation\Intermediate\ProjectFiles\Error	1
Error	MSB3073	The command ""D:\Programs\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" HitOrientationEditor Win64 Development "D:\Unreal Projects\HitOrientation\HitOrientation.uproject" -rocket -waitmutex -2015" exited with code -1.	HitOrientation	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets	37

The errors it gives if I take out BlueprintCallable:

Severity	Code	Description	Project	File	Line
Error (active)		name followed by '::' must be a class or namespace name	HitOrientation	d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp	28
Error	MSB3073	The command ""D:\Programs\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" HitOrientationEditor Win64 Development "D:\Unreal Projects\HitOrientation\HitOrientation.uproject" -rocket -waitmutex -2015" exited with code -1.	HitOrientation	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets	37
Error	code	OtherCompilationError (5)	HitOrientation	D:\Unreal Projects\HitOrientation\Intermediate\ProjectFiles\Error	1
Error (active)		name followed by '::' must be a class or namespace name	HitOrientation	d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp	6
Error (active)		name followed by '::' must be a class or namespace name	HitOrientation	d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp	14
Error (active)		name followed by '::' must be a class or namespace name	HitOrientation	d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp	21
Error (active)		this declaration has no storage class or type specifier	HitOrientation	d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.h	6
Error (active)		expected a ';'	HitOrientation	d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.h	7

Remove BlueprintCallable from the blueprint property specifiers for AHitTester::CallTest.

It gives me the same errors and then goes on to show even more errors. I updated the question with the errors it shows. I am very confused.

I could be wrong I believe that BlueprintPure functions are required to be static these days. That’s how I write them. give that a test. BlueprintPure functions are meant to be functions that don’t necessarily change the owning object. Though, you could pass in values and then change them. Removing the BlueprintCallable means that there are no exec pins. If you need exec pins then re add that.

If I take the variables out of CallTest() and make CallTest() static then it just gives me the original error. I am very confused.

Hey PappySnail-

The “OtherCompilationError (5)” message typically indicates an error that VS . If you go to the Output Tab rather than the Error tab in VS and post the results after attempting to compile it will help point to where exactly the compile error is occurring and how to fix it.

Cheers

As suggested, post the output log. With UE4, the error log is pretty worthless.

I am very embarrassed to have not known this. It told me exactly what the error was and how it fix it. Thank you!

Turns out it was a huge mistake on my part. You were right about the class having to be static, and it needs an input or output. Thanks for sticking with me!

Edit: Is there a way for a node to have the exec pins from BlueprintCallable AND have no target input like BlueprintPure? I can’t seem to get the exec pins back even if I add BlueprintCallable.

What was the issue? I am curious to know.

Removing BlueprintPure and adding BlueprintCallable should do that. Unless static functions are not allowed to be BlueprintCallable on their own. You can go ahead and test that. I would if I was home.

whoops. I see your comment on the other thread.

Wow! You are right! Static void gets rid of the target input. Thanks man!

Nope… Static is needed on BP Pure…