I’m using visual studio 2015 and writing codes for plugin.
I met unresolved external symbol error, but it’s disappeared if I build again without modifying my codes.
here is build output message.
------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
------ Build started: Project: MyFirstTopDown, Configuration: Development_Editor x64 ------
Compiling game modules for hot reload
Target is up to date
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
After modify codes and build projects, error appears!
What’s the problem?
Additional informations:
here is my simple plugin class
class FMyModule : public IModuleInterface
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
static FMyModule& Get();
void SendLog(const FString&);
private:
/** Handle to the test dll we will load */
void* ExampleLibraryHandle;
static FMyModule* Singleton;
};
and here is how do I call this plugin’s method and error log:
FString log = FString::Printf(TEXT("tick %d"), ++logSent);
UE_LOG(LogTemp, Warning, TEXT("%s"), *log);
FMyModule::Get().SendLog(log);
FMyModule::Get().SendLog("abcd");
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "public: static class FMyModule & __cdecl FMyModule::Get(void)" (?Get@FMyModule@@SAAEAV1@XZ) referenced in function "public: virtual void __cdecl AMyFirstTopDownCharacter::Tick(float)" (?Tick@AMyFirstTopDownCharacter@@UEAAXM@Z) MyFirstTopDown C:\Users\juhong.jung\Documents\Unreal Projects\MyFirstTopDown\Intermediate\ProjectFiles\MyFirstTopDownCharacter.cpp.obj 1
Error LNK2019 unresolved external symbol "public: void __cdecl FMyModule::SendLog(class FString const &)" (?SendLog@FMyModule@@QEAAXAEBVFString@@@Z) referenced in function "public: virtual void __cdecl AMyFirstTopDownCharacter::Tick(float)" (?Tick@AMyFirstTopDownCharacter@@UEAAXM@Z) MyFirstTopDown C:\Users\juhong.jung\Documents\Unreal Projects\MyFirstTopDown\Intermediate\ProjectFiles\MyFirstTopDownCharacter.cpp.obj 1