I managed to compile as a library by adding to my .Target (the game one, not the editor) the lines on the docs but in order to get the entry points I also needed to add ExtraModuleNames.Add("UELibrary") to my Target.
After that and after switching Rider to “Development” configuration, I was able to compile as a DLL. Had some problems on my code due to the fact that Monolithic Builds seem to have differences in the include (i.e. ParallelFor needs to be explicitly included where used). Also had some problems with MovieScene module, which is used by the Launcher module: this requires the fix I have proposed here: Fix MovieSceneCommonHelpers.cpp in monolithic build by mattiascibien · Pull Request #8357 · EpicGames/UnrealEngine (github.com)
Be sure to check your DLL with an export viewer to verify that it has the exported functions.
Thanks for your generous answer. I will try as you told add additional code ExtraModuleNames.Add("UELibrary") to my Target(the game one). In addition, i hope you tell me which Startup project you choose, UnrealBuild Tool or the others and which one you built , the UE4 or MyGame (the game one i created) or the whole solution?
i want to know whether i had some mistakes on creating my own projects ‘MyGame’. I don’t test embedding. I built the source code ,debugged it and started UE4 engine, then i used the UE engine to create my game project as showed in the picture. And then i just right click MyGame and build it , is there anything wrong? Thank you for your time.
yeah, i followed the guide add
GlobalDefinitions.Add(“UE_LIBRARY_ENABLED=1”);
LinkType = TargetLinkType.Monolithic;
bShouldCompileAsDLL = true;
the code to MyGame.Target.cs. and use the UE 4.27.0 release form github. The only thing i’m not sure is which startup project i should choose or it doesn’t matter.
You should not choose one as the output will be a DLL. Just compile it and you will get a dll named after your project (Without UE4Editor- prefix) in your Binaries\Win64 directory.
EDIT: I am testing DLL loading in a Win32 app now but I am still investigating. The dll anyway is called fine.
Hello friend.
You can find enable, visualize Show Plugins Content and Show Engine Content. So, after that locate what you are looking for in Plugin Directory.
I hope this can help you.
So, was setting up 4.27 source and this happened. I don’t usually get false positives and didn’t have this issue with 4.16 - 4.26. I still have same AV.
Alright, failing to build from source if I want to build with FileSever:
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Components/ActorComponent.h(375): error C3668: ‘UActorComponent::GetWorld’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Engine/Level.h(757): error C3668: ‘ULevel::GetWorld’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(2912): error C3668: ‘AActor::GetWorld’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Public\Subsystems/WorldSubsystem.h(24): error C3668: ‘UWorldSubsystem::GetWorld’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Engine/World.h(1650): error C2065: ‘FAsyncPreRegisterDDCRequest’: undeclared identifier
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Engine/World.h(1650): error C2923: ‘TSharedPtr’: ‘FAsyncPreRegisterDDCRequest’ is not a valid template type argument for parameter ‘ObjectType’
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Engine/World.h(1650): error C2976: ‘TSharedPtr’: too few template arguments
27> E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Core\Public\Templates/SharedPointer.h(560): note: see declaration of ‘TSharedPtr’
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Engine/World.h(1650): error C3203: ‘TSharedPtr’: unspecialized class template can’t be used as a template argument for template parameter ‘InElementType’, expected a real type
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Engine/World.h(2564): error C3668: ‘UWorld::GetWorld’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Public\Physics/PhysicsInterfacePhysX.h(173): error C2504: ‘FChaosEngineInterface’: base class undefined
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Curves/CurveBase.h(82): error C3668: ‘UCurveBase::PostEditChangeProperty’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Sound/SoundEffectSource.h(62): error C3668: ‘USoundEffectSourcePresetChain::PostEditChangeProperty’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Animation/AnimNotifies/AnimNotify.h(94): error C3668: ‘UAnimNotify::GetWorld’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Animation/AnimInstance.h(1285): error C3668: ‘UAnimInstance::GetWorld’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Engine/NetDriver.h(1496): error C3668: ‘UNetDriver::GetWorld’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Engine/NetConnection.h(814): error C3668: ‘UNetConnection::GetWorld’: method with override specifier ‘override’ did not override any base class methods
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\Engine\Classes\Engine/LocalPlayer.h(277): error C3668: ‘ULocalPlayer::GetWorld’: method with override specifier ‘override’ did not override any base class methods
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(92): error C2653: ‘FChaosEngineInterface’: is not a class or namespace name
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(92): error C3861: ‘ReleaseMaterial’: identifier not found
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(103): error C2027: use of undefined type ‘FPhysicsMaterialHandle_PhysX’
27> E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\PhysicsCore\Public\PhysicsInterfaceDeclaresCore.h(188): note: see declaration of ‘FPhysicsMaterialHandle_PhysX’
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(103): error C2232: ‘->TUniquePtr<FPhysicsMaterialHandle,TDefaultDelete>::IsValid’: left operand has ‘class’ type, use ‘.’
27> with
27> [
27> T=FPhysicsMaterialHandle
27> ]
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(105): error C2653: ‘FChaosEngineInterface’: is not a class or namespace name
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(105): error C3861: ‘CreateMaterial’: identifier not found
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(105): error C2582: ‘operator =’ function is unavailable in ‘FPhysicsMaterialHandle_PhysX’
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(106): error C2027: use of undefined type ‘FPhysicsMaterialHandle_PhysX’
27> E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\PhysicsCore\Public\PhysicsInterfaceDeclaresCore.h(188): note: see declaration of ‘FPhysicsMaterialHandle_PhysX’
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(106): error C2232: ‘->TUniquePtr<FPhysicsMaterialHandle,TDefaultDelete>::IsValid’: left operand has ‘class’ type, use ‘.’
27> with
27> [
27> T=FPhysicsMaterialHandle
27> ]
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(108): error C2653: ‘FChaosEngineInterface’: is not a class or namespace name
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(108): error C3861: ‘SetUserData’: identifier not found
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(109): error C2653: ‘FChaosEngineInterface’: is not a class or namespace name
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/PhysicsCore/Private/PhysicalMaterial.cpp(109): error C3861: ‘UpdateMaterial’: identifier not found
27>E:/UE4Source/UE-oculus-4270-release-1640/Engine/Source/Runtime/SlateNullRenderer/Private/SlateNullRendererModule.cpp(12): fatal error C1083: Cannot open include file: ‘TextureResource.h’: No such file or directory
27>E:\UE4Source\UE-oculus-4270-release-1640\Engine\Source\Runtime\NetworkFileSystem\Public\INetworkFileSystemModule.h(7): fatal error C1083: Cannot open include file: ‘ShaderCompiler.h’: No such file or directory
27>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(46,5): error MSB3073: The command “…..\Build\BatchFiles\Build.bat UnrealFileServer Win64 Development -WaitMutex -FromMsBuild” exited with code 6.
27>Done building project “UnrealFileServer.vcxproj” – FAILED.
Thanks very much. I have found my faults that i chose a wrong solution configurations “Development Editor”.After switching Rider to “Development” configuration as you told, I was able to compile as a DLL. Thank you
Besides, i tried adding ExtraModuleNames.Add("UELibrary") to my Target and not adding code. If don’t add the code above , we can’t find the function UE provided for us (like UELibrary_InitA) . Do you know how this works? Why does adding code
" ExtraModuleNames.Add(“UELibrary”) " works?
Works because it seems that UELibrary is not included as a module and therefore it is not included (this step is actually missing from the documentation). I was also able to compile Shipping and DebugGame.
Did you have problems with MovieScene (they actually merged my fix in 4.27 on Github so I guess it will go into release)? IF you manage to embed and run correctly would you mind sharing the project? On my side I am having problems with loading data (it seems that shader cache is not availeable but I cannot find why).
Thanks, i’m a green hand, i should learn more about Target and Module to understand this problem better.
I just copy the MovieScene code you fixed and try compiling. I’ll try not to use the modified MovieScene file and see if it compiles in the future. Now i just create a simple blank project(named MyGame) and MovieScene is not yet involved. I will try starting the UE engine by using UELibrary_InitA, but it’s still unsuccessful up to now. Because i don’t know how to pass the parameters like HINSTANCE hInst and HWND MainWnd, i should learn more about windows programming. If i have any progress i will tell you,We can keep in touch and communicate at any time.
So, my 4.26.2 project had skeletal characters. After upgrading to 4.27, everything seems to work fine, except skeletal meshes don’t render on Oculus Quest 2. Characters seem to work and anim plays fine. It’s just skinned/weighted mesh itself doesn’t render.
Okay, it finally happened. First, the launcher crashed at the end of the installation:
Assertion failed: !bIsInitialized [File:D:/build/++Portal/Sync/Portal/Source/Programs/EpicGamesLauncher/Layers/DataAccess/Private/Analytics/CommunityPortalAnalytics.cpp] [Line: 183] FCommunityPortalAnalyticsAnalytics::Initialize called more than once.
Afterwards the engine looked successfully installed, so I converted my working 4.26 project and it crashed at loading 75%:
What I see is a python script plugin, an alien to me experimental beta feature, that I’ve never used before, for some reason apears to be forcedly turned on in the engine and ruins my project?
A new sample based project appears to be working, I even tried to uncheck the aformentioned plugin, but it didn’t help.
I also tried to launch a marketplace sample project “Zen Garden”, once again converting from 4.26, then the crash was motivated by an error in “oodle texture”
Assertion failed: !bIsInitialized [File:D:/build/++Portal/Sync/Portal/Source/Programs/EpicGamesLauncher/Layers/DataAccess/Private/Analytics/CommunityPortalAnalytics.cpp] [Line: 183] FCommunityPortalAnalyticsAnalytics::Initialize called more than once.