Author Topic: Substance and UWP  (Read 2301 times)

Hi all,

Currently trying to get the Substance plugin working with the UWP UE4 fork and running into a few issues that I wonder if anyone here has been able to resolve.

When compiling for UWP64 I get the following:

Code: [Select]
2>LINK : warning LNK4199: /DELAYLOAD:libogg_64.dll ignored; no imports found from libogg_64.dll
2>LINK : warning LNK4199: /DELAYLOAD:libvorbis_64.dll ignored; no imports found from libvorbis_64.dll
2>Module.Icmp.cpp.obj : error LNK2019: unresolved external symbol "unsigned short __cdecl NtoHS(unsigned short)" (?NtoHS@@YAGG@Z) referenced in function "struct FIcmpEchoResult __cdecl UDPEchoImpl(class ISocketSubsystem *,class FString const &,float)" (?UDPEchoImpl@@YA?AUFIcmpEchoResult@@PEAVISocketSubsystem@@AEBVFString@@M@Z)
2>Module.Icmp.cpp.obj : error LNK2019: unresolved external symbol "unsigned short __cdecl HtoNS(unsigned short)" (?HtoNS@@YAGG@Z) referenced in function "struct FIcmpEchoResult __cdecl UDPEchoImpl(class ISocketSubsystem *,class FString const &,float)" (?UDPEchoImpl@@YA?AUFIcmpEchoResult@@PEAVISocketSubsystem@@AEBVFString@@M@Z)
2>Module.Icmp.cpp.obj : error LNK2019: unresolved external symbol "unsigned int __cdecl HtoNL(unsigned int)" (?HtoNL@@YAII@Z) referenced in function "struct FIcmpEchoResult __cdecl UDPEchoImpl(class ISocketSubsystem *,class FString const &,float)" (?UDPEchoImpl@@YA?AUFIcmpEchoResult@@PEAVISocketSubsystem@@AEBVFString@@M@Z)
2>substance_sse2_blend_static.lib(maindetailcontextimpl.obj) : error LNK2019: unresolved external symbol __imp_GetModuleHandleW referenced in function algSyncThreadGetPhysicalProcessorCount
2>substance_sse2_blend_static.lib(maindetailhandleimpl.obj) : error LNK2019: unresolved external symbol __imp_VirtualAlloc referenced in function algExecMemoryCreate
2>algcompression.lib(Alloc.obj) : error LNK2001: unresolved external symbol __imp_VirtualAlloc
2>substance_sse2_blend_static.lib(maindetailhandleimpl.obj) : error LNK2019: unresolved external symbol __imp_VirtualProtect referenced in function algExecMemoryCreate

I have added UWP, UWP32 and UWP64 to the WhitelistPlatforms in the Substance.uplugin file and in the SubstanceEngine.Build.cs file I have added the following to pickup the Win32/64 libraries:

Code: [Select]
if (Target.Platform == UnrealTargetPlatform.Win32 ||
        Target.Platform == UnrealTargetPlatform.Win64
||  Target.Platform == UnrealTargetPlatform.UWP64
|| Target.Platform == UnrealTargetPlatform.UWP32)
{


I feel like it should work but I'm missing something here. Any suggestions would be greatful.

Thanks,
Jon



Hi Jon,

I'm having the same issue while trying to create the UWP package.
Were you able to solve this issue?

Thanks,
Toni

Hi All,

it seems that I was finally able to solve this issue.
I added the path of the kernel32.lib from the Windows SDK x64 folder (e.g. C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17134.0\um\x64\kernel32.Lib) to the PublicAdditionalLibraries in the SubstanceCore.Build.cs file and rebuilt the plugin.
After that I was able to package my project and it worked on Xbox as well.

If there is a better/cleaner way to fix this, please let me know.

Thanks,
Toni

Hi All,

it seems that I was finally able to solve this issue.
I added the path of the kernel32.lib from the Windows SDK x64 folder (e.g. C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17134.0\um\x64\kernel32.Lib) to the PublicAdditionalLibraries in the SubstanceCore.Build.cs file and rebuilt the plugin.
After that I was able to package my project and it worked on Xbox as well.

If there is a better/cleaner way to fix this, please let me know.

Thanks,
Toni

Thanks for posting this solution! I have asked the devs to take a look as well.

Cheers,
Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Having a similar issue compiling the UWP engine source code with the 4.19.0.29 plugin. Here's the error log:
Code: [Select]
4>------ Build started: Project: UE4, Configuration: Development_Editor x64 ------
4>Creating makefile for UE4Editor (no existing makefile)
4>Performing full C++ include scan (no include cache file)
4>UnrealBuildTool : error : Unable to instantiate module 'SubstanceCore': System.NullReferenceException: Object reference not set to an instance of an object.
4>                           at UnrealBuildTool.Rules.SubstanceCore..ctor(ReadOnlyTargetRules Target) in z:\Files\MICROSOFT_UWP_UNREAL-release_uwp\Engine\Plugins\Runtime\Substance\Source\SubstanceCore\SubstanceCore.Build.cs:line 116
4>                        (referenced via UE4Editor.Target.cs -> Substance.uplugin)
4>Z:\Software\Visual Studio\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command "..\..\Build\BatchFiles\Build.bat UE4Editor Win64 Development -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.
4>Done building project "UE4.vcxproj" -- FAILED.
========== Build: 3 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Hi geogos999,

you need to modify the SubstanceCore.Build.cs file to avoid the null reference exception as described here: https://forum.allegorithmic.com/index.php/topic,23285.msg96603/highlight,null+reference.html

Basically you can comment out the lines used to finally set the IncludePS4Files property, and set it to false manually.
Then you should be able to rebuild the plugin.

Regards,
Toni

One quick follow up to my solution posted above.
Unfortunately WACK will fail because of unsupported APIs:

Error Found: The supported APIs test detected the following errors:
  • API GetModuleHandleW in kernel32.dll is not supported for this application type. UWPMemoryTest-UWP64-Shipping.exe calls this API.
  • API VirtualAlloc in kernel32.dll is not supported for this application type. UWPMemoryTest-UWP64-Shipping.exe calls this API.
  • API VirtualProtect in kernel32.dll is not supported for this application type. UWPMemoryTest-UWP64-Shipping.exe calls this API.
  • API D3D12GetDebugInterface in d3d12.dll is not supported for this application type. UWPMemoryTest-UWP64-Shipping.exe calls this API.

The first three in the list are related to this issue.

Regards,
Toni
Last Edit: September 02, 2018, 07:47:26 pm