Adjusted code to
TSharedPtr<FJsonObject> JsonObject = MakeShareable(new FJsonObject());
TSharedRef< TJsonReader<> > JsonReader = TJsonReaderFactory<>::Create("{\"table\":{\"columnNames\":\"actor\",\"height\"],\"columnTypes\":\"String\",\"float\"],\"columnUnits\":[null,\"m\"],\"rows\":\"11111\",2.5],\"11111\",2.4]]}}");
//{ table: { columnNames: actor, height ], ColumnTypes: String, float ], columnUnits: null, m ], rows: 11111, 2.5 ], 11111, 2.4 ] ] } }");
// Deserialize the JSON data
if (FJsonSerializer::Deserialize(JsonReader, JsonObject) &&
JsonObject.IsValid())
{
TSharedPtr<FJsonObject> jsonObj = JsonObject->GetObjectField("table");
TArray<TSharedPtr<FJsonValue>> objArray = jsonObj->GetArrayField("rows");
for (int32 i = 0; i < objArray.Num(); i++)
{
TArray<TSharedPtr<FJsonValue>> height = objArray*->AsArray();
FString name = height[0]->AsString();
UE_LOG(LogTemp, Warning, TEXT("Value I'm looking for %s"), *name);
};
};
Still resolving in the massive error below
2>SMyCompoundWidget.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 "public: void __cdecl SMyCompoundWidget::Construct(struct SMyCompoundWidget::FArguments const &)" (?Construct@SMyCompoundWidget@@QEAAXAEBUFArguments@1@@Z)
2>SMyCompoundWidget.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 "public: void __cdecl SMyCompoundWidget::Construct(struct SMyCompoundWidget::FArguments const &)" (?Construct@SMyCompoundWidget@@QEAAXAEBUFArguments@1@@Z)
2>SMyCompoundWidget.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)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl FJsonValueString::~FJsonValueString(void)" (__imp_??1FJsonValueString@@UEAA@XZ) referenced in function "public: virtual void * __cdecl FJsonValueString::`scalar deleting destructor'(unsigned int)" (??_GFJsonValueString@@UEAAPEAXI@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonValueNumber::FJsonValueNumber(double)" (__imp_??0FJsonValueNumber@@QEAA@N@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)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl FJsonValueNumber::~FJsonValueNumber(void)" (__imp_??1FJsonValueNumber@@UEAA@XZ) referenced in function "public: virtual void * __cdecl FJsonValueNumber::`scalar deleting destructor'(unsigned int)" (??_GFJsonValueNumber@@UEAAPEAXI@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonValueBoolean::FJsonValueBoolean(bool)" (__imp_??0FJsonValueBoolean@@QEAA@_N@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)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl FJsonValueBoolean::~FJsonValueBoolean(void)" (__imp_??1FJsonValueBoolean@@UEAA@XZ) referenced in function "public: virtual void * __cdecl FJsonValueBoolean::`scalar deleting destructor'(unsigned int)" (??_GFJsonValueBoolean@@UEAAPEAXI@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonValueArray::FJsonValueArray(class TArray<class TSharedPtr<class FJsonValue,0>,class FDefaultAllocator> const &)" (__imp_??0FJsonValueArray@@QEAA@AEBV?$TArray@V?$TSharedPtr@VFJsonValue@@$0A@@@VFDefaultAllocator@@@@@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)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl FJsonValueArray::~FJsonValueArray(void)" (__imp_??1FJsonValueArray@@UEAA@XZ) referenced in function "public: virtual void * __cdecl FJsonValueArray::`scalar deleting destructor'(unsigned int)" (??_GFJsonValueArray@@UEAAPEAXI@Z)
2>SMyCompoundWidget.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 "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)
2>SMyCompoundWidget.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)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonValueNull::FJsonValueNull(void)" (__imp_??0FJsonValueNull@@QEAA@XZ) 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)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl FJsonValueNull::~FJsonValueNull(void)" (__imp_??1FJsonValueNull@@UEAA@XZ) referenced in function "public: virtual void * __cdecl FJsonValueNull::`scalar deleting destructor'(unsigned int)" (??_GFJsonValueNull@@UEAAPEAXI@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl FJsonObject::SetField(class FString const &,class TSharedPtr<class FJsonValue,0> const &)" (__imp_?SetField@FJsonObject@@QEAAXAEBVFString@@AEBV?$TSharedPtr@VFJsonValue@@$0A@@@@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)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class TArray<class TSharedPtr<class FJsonValue,0>,class FDefaultAllocator> const & __cdecl FJsonObject::GetArrayField(class FString const &)const " (__imp_?GetArrayField@FJsonObject@@QEBAAEBV?$TArray@V?$TSharedPtr@VFJsonValue@@$0A@@@VFDefaultAllocator@@@@AEBVFString@@@Z) referenced in function "public: void __cdecl SMyCompoundWidget::Construct(struct SMyCompoundWidget::FArguments const &)" (?Construct@SMyCompoundWidget@@QEAAXAEBUFArguments@1@@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class TSharedPtr<class FJsonObject,0> const & __cdecl FJsonObject::GetObjectField(class FString const &)const " (__imp_?GetObjectField@FJsonObject@@QEBAAEBV?$TSharedPtr@VFJsonObject@@$0A@@@AEBVFString@@@Z) referenced in function "public: void __cdecl SMyCompoundWidget::Construct(struct SMyCompoundWidget::FArguments const &)" (?Construct@SMyCompoundWidget@@QEAAXAEBUFArguments@1@@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonObject::FJsonObject(void)" (__imp_??0FJsonObject@@QEAA@XZ) 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)
2>SMyCompoundWidget.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)
2>SMyCompoundWidget.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)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FString __cdecl FJsonValueArray::GetType(void)const " (?GetType@FJsonValueArray@@MEBA?AVFString@@XZ)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FString __cdecl FJsonValueBoolean::GetType(void)const " (?GetType@FJsonValueBoolean@@MEBA?AVFString@@XZ)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FString __cdecl FJsonValueNull::GetType(void)const " (?GetType@FJsonValueNull@@MEBA?AVFString@@XZ)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FString __cdecl FJsonValueNumber::GetType(void)const " (?GetType@FJsonValueNumber@@MEBA?AVFString@@XZ)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FString __cdecl FJsonValueObject::GetType(void)const " (?GetType@FJsonValueObject@@MEBA?AVFString@@XZ)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FString __cdecl FJsonValueString::GetType(void)const " (?GetType@FJsonValueString@@MEBA?AVFString@@XZ)
2>SMyCompoundWidget.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)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueArray::TryGetArray(class TArray<class TSharedPtr<class FJsonValue,0>,class FDefaultAllocator> const * &)const " (?TryGetArray@FJsonValueArray@@UEBA_NAEAPEBV?$TArray@V?$TSharedPtr@VFJsonValue@@$0A@@@VFDefaultAllocator@@@@@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValue::TryGetBool(bool &)const " (?TryGetBool@FJsonValue@@UEBA_NAEA_N@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueBoolean::TryGetBool(bool &)const " (?TryGetBool@FJsonValueBoolean@@UEBA_NAEA_N@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueNumber::TryGetBool(bool &)const " (?TryGetBool@FJsonValueNumber@@UEBA_NAEA_N@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueString::TryGetBool(bool &)const " (?TryGetBool@FJsonValueString@@UEBA_NAEA_N@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValue::TryGetNumber(double &)const " (?TryGetNumber@FJsonValue@@UEBA_NAEAN@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueBoolean::TryGetNumber(double &)const " (?TryGetNumber@FJsonValueBoolean@@UEBA_NAEAN@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueNumber::TryGetNumber(double &)const " (?TryGetNumber@FJsonValueNumber@@UEBA_NAEAN@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueString::TryGetNumber(double &)const " (?TryGetNumber@FJsonValueString@@UEBA_NAEAN@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValue::TryGetObject(class TSharedPtr<class FJsonObject,0> const * &)const " (?TryGetObject@FJsonValue@@UEBA_NAEAPEBV?$TSharedPtr@VFJsonObject@@$0A@@@@Z)
2>SMyCompoundWidget.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)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValue::TryGetString(class FString &)const " (?TryGetString@FJsonValue@@UEBA_NAEAVFString@@@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueBoolean::TryGetString(class FString &)const " (?TryGetString@FJsonValueBoolean@@UEBA_NAEAVFString@@@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueNumber::TryGetString(class FString &)const " (?TryGetString@FJsonValueNumber@@UEBA_NAEAVFString@@@Z)
2>SMyCompoundWidget.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FJsonValueString::TryGetString(class FString &)const " (?TryGetString@FJsonValueString@@UEBA_NAEAVFString@@@Z)