【UE5】第一次尝试项目转插件(Plugin)的时候,无法编译

VS显示100条左右的错误,UE热编译也不能通过。原因可能是名字.Build.cs文件的错误,缺少一些内容,比如说如果要写UserWidget类,那么就要在 ]名字.Build.cs]

中加入如下内容:

cpp 复制代码
public class beibaoxitong : ModuleRules
{
	public beibaoxitong(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
		
		PublicIncludePaths.AddRange(
			new string[] {
                 System.IO.Path.Combine(ModuleDirectory, "Public")
				// ... add public include paths required here ...
			}
			);
				
		
		PrivateIncludePaths.AddRange(
			new string[] {
                System.IO.Path.Combine(ModuleDirectory, "Private")
				// ... add other private include paths required here ...
			}
			);
			
		
		PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",
                "CoreUObject",
                      "Engine",
                    "SlateCore",
                    "UMG"			
				// ... add other public dependencies that you statically link with here ...
			, "InputCore", "EnhancedInput","ProceduralMeshComponent"
}
			);
			
		
		PrivateDependencyModuleNames.AddRange(
			new string[]
			{
				"CoreUObject",
				"Engine",
				"Slate",
				"SlateCore",
				// ... add private dependencies that you statically link with here ...	
			"UMGEditor", "UMGEditor","UMG", "InputDevice", "InputDevice", "InputDevice" 
}
			);
		
		
		DynamicallyLoadedModuleNames.AddRange(
			new string[]
			{
				// ... add any modules that your module loads dynamically here ...
			}
			);
	}
}

根据你的文件进行添加。如果说依然有如图的问题,那你就去原来的项目里看看哪些没加上去。

正在创建库 D:\Unreal\Weather\Plugins\beibaoxitong\Binaries\Win64\UnrealEditor-beibaoxitong.patch_1.lib 和对象 D:\Unreal\Weather\Plugins\beibaoxitong\Binaries\Win64\UnrealEditor-beibaoxitong.patch_1.exp

Module.beibaoxitong.cpp.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static struct FKey const EKeys::RightMouseButton" (_imp ?RightMouseButton@EKeys@@2UFKey@@B),函数 "public: virtual class FReply __cdecl UInventorySlot::NativeOnMouseButtonDown(struct FGeometry const &,struct FPointerEvent const &)" (?NativeOnMouseButtonDown@UInventorySlot@@UEAA?AVFReply@@AEBUFGeometry@@AEBUFPointerEvent@@@Z) 中引用了该符号

D:\Unreal\Weather\Plugins\beibaoxitong\Binaries\Win64\UnrealEditor-beibaoxitong.patch_1.exe : fatal error LNK1120: 1 个无法解析的外部命令

Failed to link patch (0.000s) (Exit code: 0x460)

相关推荐
dong1326972 天前
UE5FPS游戏开发教程(一)
ue5
朗迹 - 张伟3 天前
UE5.8 用Trae的AI开发功能
ue5
日月云棠5 天前
UE5 Lyra Teams模块深度分析:从队伍创建到伤害判定的完整链路
ue5
日月云棠7 天前
UE5 Lyra Inventory 物品系统模块深度分析——从数据定义到网络同步的完整链路
ue5
日月云棠8 天前
UE5 Lyra Weapons 模块深度分析——从装备实例到弹道散布的完整武器系统
ue5
清泓y9 天前
UE5程序化生成技术
ue5
清泓y10 天前
UE5--VR与AR开发技术
ue5·ar·vr
日月云棠10 天前
UE5 Lyra Messages 模块深度解析——从一条击杀消息看游戏事件系统的设计哲学
游戏·ue5
日月云棠11 天前
UE5 Lyra Input 模块:从手柄摇杆到技能释放,一条链路如何做到零耦合
ue5
日月云棠14 天前
UE5 Lyra源码分析——Audio_Analysis音频模块全面分析
ue5·音视频