Hello everyone,
I am attempting to create my own plugin. The version of Unreal Engine I am using is 5.0.3.
As a beginner, I wrote a program to define a float variable and output its value. However, this results in a compilation error.
Below is the current content of the header file and cpp file:
sEasingBPLibrary.h:
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "sEasingBPLibrary.generated.h"
UCLASS()
class USEASING_API UsEasingBPLibrary : public UBlueprintFunctionLibrary
{
GENERATED_UCLASS_BODY()
UFUNCTION(BlueprintCallable, meta = (DisplayName = "Execute Sample function", Keywords = "sEasing sample test testing"), Category = "sEasingTesting")
static float sEasingSampleFunction(float Param);
static float test; // this is my code
};
sEasingBPLibrary.cpp:
// Copyright Epic Games, Inc. All Rights Reserved.
#include "sEasingBPLibrary.h"
#include "sEasing.h"
UsEasingBPLibrary::UsEasingBPLibrary(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
test = 10;
}
float UsEasingBPLibrary::sEasingSampleFunction(float Param)
{
return test;
}
The error message is as follows. Although it seems that there is a character encoding issue, it appears to be a linker error. Others may have encountered the same error. Can anyone knowledgeable about this provide assistance?
Module.sEasing.cpp.obj : error LNK2001: ?O???V???{?? "public: static float UsEasingBPLibrary::test" (?test@UsEasingBPLibrary@@2MA) ?͖???ł?
C:\Users\"USER NAME"\Documents\Unreal Projects\plugin_test3\Plugins\sEasing\Binaries\Win64\UnrealEditor-sEasing-8903.dll : fatal error LNK1120: 1 ???̖???̊O???Q??
Is there anyone else struggling with the same error? Experts, please help!
Thank you.