Unresolved external symbol when upgraded to 4.6.0

Hi. I just upgraded my project to new version, 4.6.0 release. Just before the upgrade everything worked just fine. I have 40 of these errors:

1>PartManager.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonValueString::FJsonValueString(class FString const &)" (__imp_??0FJsonValueString@@QEAA@AEBVFString@@@Z) referenced in function "private: static bool __cdecl FJsonSerializer::Deserialize<wchar_t>(class TSharedRef<class TJsonReader<wchar_t>,0> const &,struct FJsonSerializer::StackState &)" (??$Deserialize@_W@FJsonSerializer@@CA_NAEBV?$TSharedRef@V?$TJsonReader@_W@@$0A@@@AEAUStackState@0@@Z)

My .cpp:

#include "Krafts.h"
#include "PartManager.h"

#include "Runtime/JsonUtilities/Public/JsonUtilities.h" // <==== this is really necessary here if converting Json
#include "Runtime/JsonUtilities/Public/JsonObjectConverter.h" // <==== this is really necessary here if converting Json

#include "CoreMisc.h"

UPartManager::UPartManager(const class FObjectInitializer& PCIP)
	: Super(PCIP)
{
	bIsInitiated = false;
}

void UPartManager::Initiate()
{
	dprint("initiating PartManager");

	FString JsonRaw = " {  blah blah JSon  }";
	
	//parse json
	TSharedRef<TJsonReader<TCHAR>> JsonReader = TJsonReaderFactory<TCHAR>::Create(JsonRaw);
	if (FJsonSerializer::Deserialize(JsonReader, JsonPartReference))
	{
		dprint("Part Reference Json Loaded");

		bIsInitiated = true;
	}
}

The code is really skethcy, I’ve just started on this project while still trying to learn inner workings of the engine. Still, I can’t decypher the error message and feel really confused.

So while I poke around by myself, trying to fix this, maybe someone here with more experience could respond sooner, and help me out?

Aaaand I got it.

I didn’t have “Json” module included in my project .Build.cs

I had just

PublicDependencyModuleNames.AddRange(new string[] { "JsonUtilities" });

When I should have had

PublicDependencyModuleNames.AddRange(new string[] { "Json", "JsonUtilities" });

Strangely, it worked just fine in 4.5.1, I wasn’t even aware of the existence of this module. I thought JsonUtilities does all the magick.

Anyways, hope this post helps someone in the future.

1 Like

Yep it sure did, got bit by the exact same issue. Thanks!

You have to add “RHI” to PublicDependencyModuleNames, in the Myprojectname.Build.cs file.

Guys is this still working for you in 4.10? After adding Json and JsonUtilities and including JsonObjectConverter.h I have lot of compiler errors at JsonUtilitiesConverter.h file.

Hi Raool,

This post is from December 2014. The editor has gone through a significant amount of changes during this time. It would be best if you open a new post detailing the specific error you are experiencing and what steps you are taking to get to that point.