编译问题记录
1.1 Action RPG编译报错
使用U5打开UE Demo Action RPG
Demo链接:https://www.unrealengine.com/marketplace/en-US/product/action-rpg-01
现象:
使用UE5打开此Demo时,在编译时,会提示找不到插件“SlateRemote”
解决方法:
可以直接打开ActionRPG.uproject,然后把“SlateRemote”的Enabled改成false,重新编译即可
1.2 启动UnrealEditor的报错
现象:
启动UnrealEditor的报错:
Plugin 'RuntimePhysXCooking' failed to load because module 'RuntimePhysXCooking' could not be found. Please ensure the plugin is properly installed, otherwise consider disabling the plugin for this project.
解决方法:
Engine\Binaries\Win64\UnrealEditor.modules里面,补充一下
"PhysXCooking": "UnrealEditor-PhysXCooking.dll",
怀疑是装rider的插件把这个文件搞坏了
1.3 UE编译时msado15.tlh报错
现象:
重新编译UE5时,报错:
1>[1/9] Touch msado15.tlh
1>[1/9]Touch msado15.tlh - Error but no output
解决方法:
参考:https://zenn.dev/shiena/scraps/19d01c0ad6af72
删掉这个目录:“Engine\Plugins\Runtime\Database\ADOSupport\Intermediate\Build\Win64\UnrealEditor\Development\ADOSupport”
1.4 UE编译成Game时,链接GLiveCodingEngineDir报错
现象:
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "wchar_t * GInternalProjectName" (?GInternalProjectName@@3PA_WA) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "wchar_t const * const GForeignEngineDir" (?GForeignEngineDir@@3PEB_WEB) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "wchar_t const * const GLiveCodingEngineDir" (?GLiveCodingEngineDir@@3PEB_WEB) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "wchar_t const * const GLiveCodingProject" (?GLiveCodingProject@@3PEB_WEB) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "class FChunkedFixedUObjectArray * & GObjectArrayForDebugVisualizers" (?GObjectArrayForDebugVisualizers@@3AEAPEAVFChunkedFixedUObjectArray@@EA) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void * __cdecl operator new(unsigned __int64)" (??2@YAPEAX_K@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void * __cdecl operator new(unsigned __int64,struct std::nothrow_t const &)" (??2@YAPEAX_KAEBUnothrow_t@std@@@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPEAX@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void __cdecl operator delete(void *,struct std::nothrow_t const &)" (??3@YAXPEAXAEBUnothrow_t@std@@@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void __cdecl operator delete(void *,unsigned __int64,struct std::nothrow_t const &)" (??3@YAXPEAX_KAEBUnothrow_t@std@@@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void * __cdecl operator new[](unsigned __int64)" (??_U@YAPEAX_K@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void * __cdecl operator new[](unsigned __int64,struct std::nothrow_t const &)" (??_U@YAPEAX_KAEBUnothrow_t@std@@@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPEAX@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void __cdecl operator delete[](void *,struct std::nothrow_t const &)" (??_V@YAXPEAXAEBUnothrow_t@std@@@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void __cdecl operator delete[](void *,unsigned __int64)" (??_V@YAXPEAX_K@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "void __cdecl operator delete[](void *,unsigned __int64,struct std::nothrow_t const &)" (??_V@YAXPEAX_KAEBUnothrow_t@std@@@Z) Already in project name .cpp.obj In the definition of
1>MultPlayerWAN_Test02.cpp.obj : error LNK2005: "unsigned char * * GNameBlocksDebug" (?GNameBlocksDebug@@3PEAPEAEEA) Already in project name .cpp.obj In the definition of
原因:
存在多个IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, Game, "Game" )
只允许存在一个,其它的要改成:
class FSomeModuleGameModule : public FDefaultGameModuleImpl
{
};
IMPLEMENT_GAME_MODULE(FSomeModuleGameModule, SomeModule);
参考来源:https://chowdera.com/2022/01/202201231614044113.html
1.5 UE编译成Game时,链接GIsGameAgnosticExe报错
现象:
error LNK2001: unresolved external symbol “bool GIsGameAgnosticExe” (?
Error 2 error LNK2001: unresolved external symbol “bool GIsGameAgnosticExe” (?
Error 3 error LNK2001: unresolved external symbol “wchar_t * GGameName” (?GGameName@@3PA_WA)
原因:
没有IMPLEMENT_PRIMARY_GAME_MODULE
解决方法:
把其中一个模块改成IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, Game, "Game" ) 其中Game自己命名。
参考来源:https://forums.unrealengine.com/t/cant-package-my-game/282046
1.6 UE启动时,提示游戏模块加载后,无法被成功初始化
现象:
The game module 'xxx' could not be successfully initialized after it was loaded.
原因:
没有给模块'xxx'添加相应的模块初始化文件,类似这个:
class xxx : public FDefaultGameModuleImpl
解决方法:
在模块的根目录下,添加相应的模块初始化文件即可
运行问题记录
2.1 派生自UEngineSubsystem并没有跟随GEngine初始化
解决方法:在 .uproject 中的"Modules" 加入对应的UEngineSubsystem子类所对应的模块
友情链接
blog: https://www.cgsgood.tech/ue_problem_record/
语雀: https://www.yuque.com/cgsgood/dshx0b/akm88q
简书blog://www.greatytc.com/p/36663b67a629
博客园:https://www.cnblogs.com/cgsgood/p/16976734.html