First, let me apologize for my ignorance. I am a C# programmer by day, but can’t seem to get a handle on C++.
I am attempting to create a custom library of some useful functions so I can call them in my Blueprints. From what I read online, the following code should be working, but I am clearly missing something.
.h
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "DevotionBlueprintFunctionLibrary.generated.h"
/**
*
*/
UCLASS()
class OFFTHEGRID_API UDevotionBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BluePrintCallable, Category = "DevotionLibrary")
static float GetVectorDistance(FVector A, FVector B);
};
.cpp
#include "OffTheGrid.h"
#include "DevotionBlueprintFunctionLibrary.h"
float GetVectorDistance(FVector A, FVector B)
{
return FVector::Dist(A, B);
}
And here is the error I am seeing:
error LNK2019: unresolved external symbol "private: static float __cdecl UDevotionBlueprintFunctionLibrary::GetVectorDistance(struct FVector,struct FVector)" (?GetVectorDistance@UDevotionBlueprintFunctionLibrary@@CAMUFVector@@0@Z) referenced in function "public: void __cdecl UDevotionBlueprintFunctionLibrary::execGetVectorDistance(struct FFrame &,void * const)" (?execGetVectorDistance@UDevotionBlueprintFunctionLibrary@@QEAAXAEAUFFrame@@QEAX@Z) C:\Users\cheap_000\Projects\OffTheGrid\Intermediate\ProjectFiles\DevotionBlueprintFunctionLibrary.cpp.obj OffTheGrid
I am sure I am missing something simple - any ideas?