proletariatgames / unreal.hx

Unreal.hx: Haxe Integration for Unreal
MIT License
421 stars 42 forks source link

Unknown static call to uhx.templates.FObjectFinderImpl_Find_UUPackage::run #138

Open kevinresol opened 4 years ago

kevinresol commented 4 years ago

Unreal Editor v4.22.3

Haxe code:

var asset:FObjectFinder<UStaticMesh> = new FObjectFinder("/Game/MobileStarterContent/Shapes/Shape_Cube.Shape_Cube", UStaticMesh.StaticClass());

Compiler output (windows):

CompilerResultsLog: Haxe/BuildTool/interp/uhx/build/UhxBuild.hx:863: Skipping extern baker since there is nothing to compile
CompilerResultsLog: Skipping static compilation because it was not needed
CompilerResultsLog: C:\Users\kevin\AppData\Local\Yarn\bin\haxe.cmd haxe0-6598157.hxml
CompilerResultsLog: *** HAXE BUILD SUCCEEDED ***
CompilerResultsLog: Haxe call executed in 00:00:12.2214834
CompilerResultsLog: Building Haxe through a pre-build script
CompilerResultsLog: Skipping pre-build script because hooks are disabled
CompilerResultsLog: Using Visual Studio 2017 14.16.27023 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023) and Windows 10.0.17763.0 SDK (C:\Program Files (x86)\Windows Kits\10).
CompilerResultsLog: Building 4 actions with 4 processes...
CompilerResultsLog:   [1/4] MyProject3.Win-Dev-Editor.uhxglue.cpp
CompilerResultsLog:    C:\Users\kevin\Documents\Unreal Projects\MyProject3\Intermediate\Haxe\MyProject3-Win-Development-Editor\Template\Public\uhx/TypeTraits.h(59) : error C2280: 'ConstructorHelpers::FObjectFinder<UObject> &ConstructorHelpers::FObjectFinder<UObject>::operator =(const ConstructorHelpers::FObjectFinder<UObject> &)': attempting to reference a d
eleted function
CompilerResultsLog:   y:\program files\epic games\ue_4.22\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(121): note: compiler has generated 'ConstructorHelpers::FObjectFinder<UObject>::operator =' here
CompilerResultsLog:   y:\program files\epic games\ue_4.22\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(121): note: 'ConstructorHelpers::FObjectFinder<UObject> &ConstructorHelpers::FObjectFinder<UObject>::operator =(const ConstructorHelpers::FObjectFinder<UObject> &)': function was implicitly deleted because a base class invokes a del
eted or inaccessible function 'FGCObject &FGCObject::operator =(const FGCObject &)'
CompilerResultsLog:   C:\Users\kevin\Documents\Unreal Projects\MyProject3\Intermediate\Haxe\MyProject3-Win-Development-Editor\Template\Public\uhx/TypeTraits.h(58): note: while compiling class template member function 'void uhx::TypeTraits::Assign<ConstructorHelpers::FObjectFinder<UObject>>::doAssign(T &,const T &)'
CompilerResultsLog:           with
CompilerResultsLog:           [
CompilerResultsLog:               T=ConstructorHelpers::FObjectFinder<UObject>
CompilerResultsLog:           ]
CompilerResultsLog:   C:\Users\kevin\Documents\Unreal Projects\MyProject3\Intermediate\Haxe\MyProject3-Win-Development-Editor\Generated\Private\uhx/glues/FObjectFinderImpl_Glue_UE.h(66): note: see reference to function template instantiation 'void uhx::TypeTraits::Assign<ConstructorHelpers::FObjectFinder<UObject>>::doAssign(T &,const T &)' being compiled
CompilerResultsLog:           with
CompilerResultsLog:           [
CompilerResultsLog:               T=ConstructorHelpers::FObjectFinder<UObject>
CompilerResultsLog:           ]
CompilerResultsLog:   C:\Users\kevin\Documents\Unreal Projects\MyProject3\Intermediate\Haxe\MyProject3-Win-Development-Editor\Generated\Private\uhx/glues/FObjectFinderImpl_Glue_UE.h(66): note: see reference to class template instantiation 'uhx::TypeTraits::Assign<ConstructorHelpers::FObjectFinder<UObject>>' being compiled
CompilerResultsLog:   C:\Users\kevin\Documents\Unreal Projects\MyProject3\Intermediate\Haxe\MyProject3-Win-Development-Editor\Generated\Private\uhx/glues/FObjectFinderImpl_Glue_UE.h(65): note: while compiling class template member function 'void uhx::glues::FObjectFinderImpl_Glue_UE_obj<T>::assign(unreal::VariantPtr,unreal::VariantPtr)'
CompilerResultsLog:           with
CompilerResultsLog:           [
CompilerResultsLog:               T=UObject
CompilerResultsLog:           ]
CompilerResultsLog:   C:\Users\kevin\Documents\Unreal Projects\MyProject3\Intermediate\Haxe\MyProject3-Win-Development-Editor\Generated\Private\uhx/glues/FObjectFinderImpl_Glue_UE.h(76): note: see reference to class template instantiation 'uhx::glues::FObjectFinderImpl_Glue_UE_obj<T>' being compiled
CompilerResultsLog:           with
CompilerResultsLog:           [
CompilerResultsLog:               T=UObject
CompilerResultsLog:           ]
CompilerResultsLog:   C:\Users\kevin\Documents\Unreal Projects\MyProject3\Intermediate\Haxe\MyProject3-Win-Development-Editor\Generated\Private\uhx/glues/FObjectFinderImpl_Glue_UE.h(75): note: while compiling class template member function 'const uhx::StructInfo *uhx::TTemplatedData<ConstructorHelpers::FObjectFinder<UObject>>::getInfo(void)'
CompilerResultsLog:   C:\Users\kevin\Documents\Unreal Projects\MyProject3\Intermediate\Haxe\MyProject3-Win-Development-Editor\Template\Public\uhx/Wrapper.h(128): note: see reference to function template instantiation 'const uhx::StructInfo *uhx::TTemplatedData<ConstructorHelpers::FObjectFinder<UObject>>::getInfo(void)' being compiled
CompilerResultsLog:   C:\Users\kevin\Documents\Unreal Projects\MyProject3\Intermediate\Haxe\MyProject3-Win-Development-Editor\Template\Public\uhx/Wrapper.h(128): note: see reference to class template instantiation 'uhx::TTemplatedData<ConstructorHelpers::FObjectFinder<UObject>>' being compiled
CompilerResultsLog:   C:/Users/kevin/Documents/Unreal Projects/MyProject3/Intermediate/Haxe/MyProject3-Win-Development-Editor/Generated/Private/uhx/glues/FObjectFinderImpl_Find_UUObject_Glue.cpp(28): note: see reference to function template instantiation 'unreal::VariantPtr uhx::TemplateHelper<ConstructorHelpers::FObjectFinder<UObject>>::create<const TCHAR*c
onst >(const TCHAR *const )' being compiled
CompilerResultsLog:   C:/Users/kevin/Documents/Unreal Projects/MyProject3/Intermediate/Haxe/MyProject3-Win-Development-Editor/Generated/Private/uhx/glues/FObjectFinderImpl_Find_UUObject_Glue.cpp(28): note: see reference to function template instantiation 'unreal::VariantPtr uhx::TemplateHelper<ConstructorHelpers::FObjectFinder<UObject>>::create<const TCHAR*c
onst >(const TCHAR *const )' being compiled
LogMainFrame: MainFrame: Module compiling took 19.358 seconds
Warning: HotReload failed, recompile failed
HaxeLog: Error: UnrealInit.hx:240: Error while loading cppia: Bad link
Error details: Unknown static call to uhx.templates.FObjectFinderImpl_Find_UUPackage::run (0)
 in unreal.FObjectFinder::00000032798C9F30
   CallStatic at unreal/FObjectFinder.hx:8 new
kevinresol commented 4 years ago

@waneck I am not sure if I am doing it wrong or it is a bug. Because the sample platform game repo is outdated. Could you please shed some light on this?

kevinresol commented 4 years ago

I got something similar on Mac:

CompilerResultsLog: /Users/kevin/Documents/Unreal Projects/MyProject/Intermediate/Haxe/MyProject-Mac-Development-Editor/Template/Public/uhx/TypeTraits.h:59:8: error: object of type 'ConstructorHelpers::FObjectFinder<UObject>' cannot be assigned because its copy assignment operator is implicitly deleted
CompilerResultsLog:     t1 = t2;
CompilerResultsLog:        ^
CompilerResultsLog: /Users/kevin/Documents/Unreal Projects/MyProject/Intermediate/Haxe/MyProject-Mac-Development-Editor/Generated/Private/uhx/glues/FObjectFinderImpl_Glue_UE.h:66:67: note: in instantiation of member function 'uhx::TypeTraits::Assign<ConstructorHelpers::FObjectFinder<UObject> >::doAssign' requested here
CompilerResultsLog:                         uhx::TypeTraits::Assign<ConstructorHelpers::FObjectFinder<T>>::doAssign(*::uhx::TemplateHelper< ConstructorHelpers::FObjectFinder<T> >::getPointer(self), *::uhx::TemplateHelper< ConstructorHelpers::FObjectFinder<T> >::getPointer(val));
CompilerResultsLog:                                                                                        ^
CompilerResultsLog: /Users/kevin/Documents/Unreal Projects/MyProject/Intermediate/Haxe/MyProject-Mac-Development-Editor/Generated/Private/uhx/glues/FObjectFinderImpl_Glue_UE.h:76:55: note: in instantiation of member function 'uhx::glues::FObjectFinderImpl_Glue_UE_obj<UObject>::assign' requested here
CompilerResultsLog:   static uhx::glues::FObjectFinderImpl_Glue_UE_obj<T> genericImplementation;
CompilerResultsLog:                                                       ^
CompilerResultsLog: /Users/kevin/Documents/Unreal Projects/MyProject/Intermediate/Haxe/MyProject-Mac-Development-Editor/Template/Public/uhx/Wrapper.h:128:139: note: in instantiation of member function 'uhx::TTemplatedData<ConstructorHelpers::FObjectFinder<UObject> >::getInfo' requested here
CompilerResultsLog:     unreal::VariantPtr ret = uhx::expose::HxcppRuntime::createInlineTemplateWrapper((int) sizeof(T), (unreal::UIntPtr) TTemplatedData<T>::getInfo());
CompilerResultsLog:                                                                                                                                           ^
CompilerResultsLog: /Users/kevin/Documents/Unreal Projects/MyProject/Intermediate/Haxe/MyProject-Mac-Development-Editor/Generated/Private/uhx/glues/FObjectFinderImpl_Find_UUObject_Glue.cpp:28:76: note: in instantiation of function template specialization 'uhx::TemplateHelper<ConstructorHelpers::FObjectFinder<UObject> >::create<const wchar_t *const>' requeste
d here
CompilerResultsLog:         return ::uhx::TemplateHelper<ConstructorHelpers::FObjectFinder<UObject>>::create<const TCHAR * const>(UTF8_TO_TCHAR(::uhx::expose::HxcppRuntime::stringToConstChar((unreal::UIntPtr) (ObjectToFind))));
CompilerResultsLog:                                                                                   ^
CompilerResultsLog: /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/CoreUObject/Public/UObject/ConstructorHelpers.h:100:25: note: copy assignment operator of 'FObjectFinder<UObject>' is implicitly deleted because base class 'FGCObject' has a deleted copy assignment operator
CompilerResultsLog:         struct FObjectFinder : public FGCObject
CompilerResultsLog:                                ^
CompilerResultsLog: /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/CoreUObject/Public/UObject/GCObject.h:133:2: note: copy assignment operator is implicitly deleted because 'FGCObject' has a user-declared move constructor
CompilerResultsLog:         FGCObject(FGCObject&&)
CompilerResultsLog:         ^
CompilerResultsLog: In file included from /Users/kevin/Documents/Unreal Projects/MyProject/Source/MyProject/Generated/Unity/Mac-Dev-Editor/MyProject.Mac-Dev-Editor.uhxglue.cpp:5:
CompilerResultsLog: In file included from /Users/kevin/Documents/Unreal Projects/MyProject/Intermediate/Haxe/MyProject-Mac-Development-Editor/Generated/Private/uhx/glues/FObjectFinderImpl_Find_UUObject_Glue.cpp:21:
CompilerResultsLog: In file included from /Users/kevin/Documents/Unreal Projects/MyProject/Intermediate/Haxe/MyProject-Mac-Development-Editor/Template/Public/uhx/Wrapper.h:8:
CompilerResultsLog: In file included from /Users/kevin/Documents/Unreal Projects/MyProject/Intermediate/Haxe/MyProject-Mac-Development-Editor/Template/Public/uhx/StructInfo_UE.h:8:
kevinresol commented 4 years ago

FGCObject and its descendants (including the offending type here ConstructorHelpers::FObjectFinder<UObject>) cannot be assigned with the = operator, because its move constructor caused its copy assignment operator be implicitly deleted. I think this is a bug in the glue code. @waneck