Error LNK2019: unresolved external symbol FJSON VALUE

Hello I am having an error when compiling a custom class. Here is the error

1>     Creating library C:\PROJECTFURYGAME\Workspace\ProjectFury\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-FPSTemplate.suppressed.lib and object C:\PROJECTFURYGAME\Workspace\ProjectFury\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-FPSTemplate.suppressed.exp
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: double __cdecl FJsonValue::AsNumber(void)const " (__imp_?AsNumber@FJsonValue@@QEBANXZ) referenced in function "private: static bool __cdecl FJsonSerializer::Serialize<wchar_t,struct TPrettyJsonPrintPolicy<wchar_t> >(class TSharedRef<struct FJsonSerializer::FElement,0> const &,class TSharedRef<class TJsonWriter<wchar_t,struct TPrettyJsonPrintPolicy<wchar_t> >,0> const &,bool)" (??$Serialize@_WU?$TPrettyJsonPrintPolicy@_W@@@FJsonSerializer@@CA_NAEBV?$TSharedRef@UFElement@FJsonSerializer@@$0A@@@AEBV?$TSharedRef@V?$TJsonWriter@_WU?$TPrettyJsonPrintPolicy@_W@@@@$0A@@@_N@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class FString __cdecl FJsonValue::AsString(void)const " (__imp_?AsString@FJsonValue@@QEBA?AVFString@@XZ) referenced in function "private: static bool __cdecl FJsonSerializer::Serialize<wchar_t,struct TPrettyJsonPrintPolicy<wchar_t> >(class TSharedRef<struct FJsonSerializer::FElement,0> const &,class TSharedRef<class TJsonWriter<wchar_t,struct TPrettyJsonPrintPolicy<wchar_t> >,0> const &,bool)" (??$Serialize@_WU?$TPrettyJsonPrintPolicy@_W@@@FJsonSerializer@@CA_NAEBV?$TSharedRef@UFElement@FJsonSerializer@@$0A@@@AEBV?$TSharedRef@V?$TJsonWriter@_WU?$TPrettyJsonPrintPolicy@_W@@@@$0A@@@_N@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl FJsonValue::AsBool(void)const " (__imp_?AsBool@FJsonValue@@QEBA_NXZ) referenced in function "private: static bool __cdecl FJsonSerializer::Serialize<wchar_t,struct TPrettyJsonPrintPolicy<wchar_t> >(class TSharedRef<struct FJsonSerializer::FElement,0> const &,class TSharedRef<class TJsonWriter<wchar_t,struct TPrettyJsonPrintPolicy<wchar_t> >,0> const &,bool)" (??$Serialize@_WU?$TPrettyJsonPrintPolicy@_W@@@FJsonSerializer@@CA_NAEBV?$TSharedRef@UFElement@FJsonSerializer@@$0A@@@AEBV?$TSharedRef@V?$TJsonWriter@_WU?$TPrettyJsonPrintPolicy@_W@@@@$0A@@@_N@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class TArray<class TSharedPtr<class FJsonValue,0>,class FDefaultAllocator> const & __cdecl FJsonValue::AsArray(void)const " (__imp_?AsArray@FJsonValue@@QEBAAEBV?$TArray@V?$TSharedPtr@VFJsonValue@@$0A@@@VFDefaultAllocator@@@@XZ) referenced in function "private: static bool __cdecl FJsonSerializer::Serialize<wchar_t,struct TPrettyJsonPrintPolicy<wchar_t> >(class TSharedRef<struct FJsonSerializer::FElement,0> const &,class TSharedRef<class TJsonWriter<wchar_t,struct TPrettyJsonPrintPolicy<wchar_t> >,0> const &,bool)" (??$Serialize@_WU?$TPrettyJsonPrintPolicy@_W@@@FJsonSerializer@@CA_NAEBV?$TSharedRef@UFElement@FJsonSerializer@@$0A@@@AEBV?$TSharedRef@V?$TJsonWriter@_WU?$TPrettyJsonPrintPolicy@_W@@@@$0A@@@_N@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonValueObject::FJsonValueObject(class TSharedPtr<class FJsonObject,0>)" (__imp_??0FJsonValueObject@@QEAA@V?$TSharedPtr@VFJsonObject@@$0A@@@@Z) referenced in function "public: __cdecl FJsonSerializer::FElement::FElement(class TSharedRef<class FJsonObject,0> const &)" (??0FElement@FJsonSerializer@@QEAA@AEBV?$TSharedRef@VFJsonObject@@$0A@@@@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl FJsonValueObject::~FJsonValueObject(void)" (__imp_??1FJsonValueObject@@UEAA@XZ) referenced in function "public: virtual void * __cdecl FJsonValueObject::`scalar deleting destructor'(unsigned int)" (??_GFJsonValueObject@@UEAAPEAXI@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl FJsonObject::SetNumberField(class FString const &,double)" (__imp_?SetNumberField@FJsonObject@@QEAAXAEBVFString@@N@Z) referenced in function "private: bool __cdecl MasterServerHandler::MakePostRequest(class FString,struct ServerModel &)" (?MakePostRequest@MasterServerHandler@@AEAA_NVFString@@AEAUServerModel@@@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl FJsonObject::SetStringField(class FString const &,class FString const &)" (__imp_?SetStringField@FJsonObject@@QEAAXAEBVFString@@0@Z) referenced in function "private: bool __cdecl MasterServerHandler::MakePostRequest(class FString,struct ServerModel &)" (?MakePostRequest@MasterServerHandler@@AEAA_NVFString@@AEAUServerModel@@@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonObject::FJsonObject(void)" (__imp_??0FJsonObject@@QEAA@XZ) referenced in function "private: bool __cdecl MasterServerHandler::MakePostRequest(class FString,struct ServerModel &)" (?MakePostRequest@MasterServerHandler@@AEAA_NVFString@@AEAUServerModel@@@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonObject::~FJsonObject(void)" (__imp_??1FJsonObject@@QEAA@XZ) referenced in function "public: virtual void __cdecl SharedPointerInternals::TReferenceControllerWithDeleter<class FJsonObject,struct SharedPointerInternals::DefaultDeleter<class FJsonObject> >::DestroyObject(void)" (?DestroyObject@?$TReferenceControllerWithDeleter@VFJsonObject@@U?$DefaultDeleter@VFJsonObject@@@SharedPointerInternals@@@SharedPointerInternals@@UEAAXXZ)
1>Module.FPSTemplate.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class FHttpModule & __cdecl FHttpModule::Get(void)" (__imp_?Get@FHttpModule@@SAAEAV1@XZ) referenced in function "public: __cdecl MasterServerHandler::MasterServerHandler(struct MasterServerConf &,struct ServerModel &)" (??0MasterServerHandler@@QEAA@AEAUMasterServerConf@@AEAUServerModel@@@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class TSharedPtr<class FJsonObject,0> const & __cdecl FJsonValue::AsObject(void)const " (?AsObject@FJsonValue@@UEBAAEBV?$TSharedPtr@VFJsonObject@@$0A@@@XZ)
1>Module.FPSTemplate.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FString __cdecl FJsonValueObject::GetType(void)const " (?GetType@FJsonValueObject@@MEBA?AVFString@@XZ)
1>Module.FPSTemplate.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValue::TryGetArray(class TArray<class TSharedPtr<class FJsonValue,0>,class FDefaultAllocator> const * &)const " (?TryGetArray@FJsonValue@@UEBA_NAEAPEBV?$TArray@V?$TSharedPtr@VFJsonValue@@$0A@@@VFDefaultAllocator@@@@@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValue::TryGetBool(bool &)const " (?TryGetBool@FJsonValue@@UEBA_NAEA_N@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValue::TryGetNumber(double &)const " (?TryGetNumber@FJsonValue@@UEBA_NAEAN@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueObject::TryGetObject(class TSharedPtr<class FJsonObject,0> const * &)const " (?TryGetObject@FJsonValueObject@@UEBA_NAEAPEBV?$TSharedPtr@VFJsonObject@@$0A@@@@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValue::TryGetString(class FString &)const " (?TryGetString@FJsonValue@@UEBA_NAEAVFString@@@Z)
1>Module.FPSTemplate.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct FLogCategoryLogJson LogJson" (__imp_?LogJson@@3UFLogCategoryLogJson@@A)
1>C:\PROJECTFURYGAME\Workspace\ProjectFury\Binaries\Win64\UE4Editor-FPSTemplate.dll : fatal error LNK1120: 19 unresolved externals
1>ERROR : UBT error : Failed to produce item: C:\PROJECTFURYGAME\Workspace\ProjectFury\Binaries\Win64\UE4Editor-FPSTemplate.dll
1>  Total build time: 2.50 seconds (Local executor: 0.00 seconds)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command ""C:\Program Files\Epic Games\UE_4.15\Engine\Build\BatchFiles\Build.bat" FPSTemplateEditor Win64 Development "C:\PROJECTFURYGAME\Workspace\ProjectFury\ProjectFury.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.

For the peoples of the future who come across this error:

  1. Close Unreal and Visual Studio
  2. Delete your .sln and binary folder
  3. Open your Unreal Engine project folder in your file explorer.
  4. Locate the .uproject file for your project. This file is typically named after your project and has the extension .uproject, for example, MyProject.uproject.
  5. Open the .uproject file using a text editor of your choice.
  6. Add Json, and Json Utilities to the AdditionalDependencies
"Modules": [
    {
        "Name": "MyProject",
        "Type": "Runtime",
        "LoadingPhase": "Default",
        "AdditionalDependencies": [
            "Engine",
            "Json",
            "JsonUtilities"
        ]
    }
],
  1. Save and close.
  2. Right click your uproject > show more options > generate Visual Studio project files.
  3. Open Unreal and Recompile.

This worked for me, good luck!

Oh and don’t for get to include “Json.h”

1 Like