x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Was the JsonUtilities API depreciated in 4.1?

Hi all,

I have a lot of Json formatted data (contained in text files) I'd like to import for further runtime processing. As a base I started with this post here. Sadly the compilator throw an error and do not recognize the Module API Specifiers. My platform is OS X (XCode).

 /Users/Shared/UnrealEngine/4.1/Engine/Source/Runtime/JsonUtilities/Public/JsonObjectConverter.h:6:25: Variable has incomplete type 'class JSONUTILITIES_API' 

  1. Am I missing something in my project compilation set up with Module API (currently no tweak, monolithic mode I guess) or simply was the JsonUtilies API depreciated (not referenced in the API class list)?

  2. In latter case I guess the Json Serialization API Core's module will do the job, right? (I would have prefered the former as Json String to UStruct suit very well my need).

  3. I encountered a similar issue with GFileManager which was depreciated but still referenced a lot in wikis and AnswerHub's threads. Is there a quick way to check the "depreciated" state of an object/interface?

Thanks by advance, and "bravo" UE4 is really wonderful (even more with full Linux support)!

Product Version: Not Selected
Tags:
more ▼

asked May 20 '14 at 09:16 AM in C++ Programming

avatar image

metatomato
101 4 11 20

avatar image trethaller Jun 24 '14 at 09:51 AM

Did you figure out how to use JsonUtilities ? In 4.2, I tried adding a ref to the JsonUtilities module and it now compiles, but I get a link error. I noticed that the .lib is missing from the UE4 build.

avatar image metatomato Aug 22 '14 at 03:02 PM

After retrying to include JsonUtilies module, I was stuck with the same linking issue (JsonUtilities lib is missing). It works fine in editor, not for the packaged game. It seems (to confirm) this module is not runnable in game mode (/engine/Binaries/Mac do not contains the lib...) with UE4 vanilla binaries. A walk around would be to include directly the source (actually only one file) in your game module.

avatar image hdak1945 Aug 23 '14 at 10:01 PM

I should've noted that I'm currently running a custom build of 4.3.1 due to other reports of missing libraries that the publicly released version neglected to include. So ignoring your workaround, if you compiled your own engine branch, and used its editor to edit your project, it will package your release fine without any linking errors. I've updated my answer to reflect this.

However, if you metatomato (or anyone else for that matter) don't want to compile your own engine branch I wouldn't blame you for it. Vanilla Visual Studio can struggle with the size of its codebase (though now I have all the debugging symbols, which can be very useful for other things). Now why would Epic not distribute all the libraries in their public releases to make this easier for us all, that's not a question I can answer.

avatar image metatomato Aug 24 '14 at 12:31 PM

Hi hdak1945, Thanks for your detailed answer. Even if, after all, it's relatively easy and straight forward to use, the UBT building process could seem tricky at the beginning to UE4 rookies as I am (docs really missing some points...). Practical and clear explanations, like yours, do really make save time (and hair) to UE4 beginners.

You're totally right when you say "you'll never be as well served as doing it yourself", just compile and use your own branch. It's really the true power of UE4, as Epic says "just take the source and do whatever you want!". I would advise every UE4 beginners to do so! Go, compile, study and modify the UE4 sources!

avatar image metatomato Jun 24 '14 at 10:06 AM

I gave up with JsonUtilities and implemented my own data interface with the Core Json Interface (JsonObject, JsonSerializer and JsonStringReader). It works like a charm.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Update As noted above, when attempting to package your project for release it may fail to complete due to linker errors if you use the public release the engine (any version it seems). The workaround seems to be to include files from the "Engine\Source\Runtime\JsonUtilities" folder in the engine source tree for your version. Or you can as I did, compile a complete version of the engine and run from the editor it produces.

I know this is a few months old, but in case anyone else had this problem here are a few things to get you started.

First, make sure in your ProjectName.Build.cs file that you've added "JsonUtilities" to the PublicDependencyModuleNames collection

 // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
 
 using UnrealBuildTool;
 
 public ProjectName(TargetInfo Target)
 {
     PublicDependencyModuleNames.AddRange(new string[] { 
         "Core", 
         "CoreUObject", 
         "Engine", 
         "InputCore"
     });

     // Keep extra dependencies separate
     PublicDependencyModuleNames.AddRange(new string[] {
         "JsonUtilities" // <============================
     });
 }

And second, make sure you add the full-ish include path wherever you're using it in your code file (.cpp):

 #include "Runtime/JsonUtilities/Public/JsonUtilities.h"
 #include "Runtime/JsonUtilities/Public/JsonObjectConverter.h"

A example use case: to call UStructToJsonObjectString, just make sure your struct was marked with USTRUCT() and...

 FJsonObjectConverter::UStructToJsonObjectString(YourStruct::StaticStruct(), &yourStructInstance, FStringToStoreItIn, 0, 0);

in FStringToStoreItIn you should have a JSON formatted string! Enjoy.

more ▼

answered Aug 19 '14 at 09:49 AM

avatar image

hdak1945
11 1 2 1

avatar image BeariksonStudios Dec 07 '14 at 10:55 AM

I was having unresolved external symbols for Json when I was upgrading my project from V4.5 to V4.6, and this solved it for me.

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

Cheers!

avatar image Raool Feb 24 '16 at 01:24 PM

Is this still working in 4.10? After adding json and jsonutilities I get compiler errors at JsonObjectConverter.h.

avatar image Chayyy_94 Apr 25 '18 at 06:24 AM

Any Solution for this issue facing the same problem..

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question