Hey everyone,
we got the XPlatCpp SDK working in UE4 for Windows, but that's obviously nothing special, because I could just use the Plugin you peeps already made.
We do however need this to work on Linux and Xbox too and following your "C++ Quickstart for Xbox" is really tricky, because it requires a lot of steps that might not be needed when using UE4.
(Note: The JSON Library you peeps use defines "JSON_API", and so does UE4. The Library expects this to be undefined. If you ever have peeps coming in that can't get this SDK working in UE4, that's most likely the problem. We ended up changing the definition to JSON_PLAYFAB_API and it works now.)
So my question now is: What do I need to do in order to produce library files of the SDK for Xbox?
Compiling them for Windows was easy enough, but I'm not sure if I actually have to create custom Xbox files or if the Windows ones work here too.
I most likely have to create Linux ones, but that's for later.
I'm currently using this (custom) function in the build.cs of our project (or plugin if you want):
private bool LoadPlayFabXPlatformLib() { string LibrariesPath = Path.Combine(ThirdPartyPath, "PlayFabXPlatformLibrary"); bool bIsLibrarySupported = false; if (Target.Platform == UnrealTargetPlatform.Win64) { bIsLibrarySupported = true; string PlatformString = "x64"; PublicLibraryPaths.Add(Path.Combine(LibrariesPath, PlatformString)); PublicAdditionalLibraries.Add("lib_json.lib"); PublicLibraryPaths.Add(Path.Combine(LibrariesPath, PlatformString, "XPlatCppWindows")); PublicAdditionalLibraries.Add("XPlatCppWindows.lib"); } else if (Target.Platform == UnrealTargetPlatform.XboxOne) { bIsLibrarySupported = true; string PlatformString = "XboxOne"; PublicLibraryPaths.Add(Path.Combine(LibrariesPath, PlatformString)); PublicAdditionalLibraries.Add("lib_json.lib"); PublicLibraryPaths.Add(Path.Combine(LibrariesPath, PlatformString, "XPlatCppXbox")); PublicAdditionalLibraries.Add("XPlatCppXbox.lib"); } if (bIsLibrarySupported) { // Add Include Path PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "PlayFabXPlatformInclude")); } return bIsLibrarySupported; }
The windows part works fine, but I'm not sure about "lib_json.lib" and "XPlatCppXbox.lib".
They are just the copy pasted and renamed versions of Windows.
I tried opening the Xbox SDK SLN file, but I'm kinda sure I can't just compile that, cause the Target is Xbox, not x64.
Would be really awesome if someone could share some wisdom with me here.
Kind regards,
Cedric
PS: It would be awesome if you peeps from PlayFab either upgraded the UE4 Plugin to support the other two platforms or if you could at least make a guide to include this SDK into a UE4 project.
PS2: Why did you recreate the SDK from scratch for UE4 instead of just using the library and wrapping it into some exposed UE4 functions/variables?