【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)

相关推荐
心怀梦想的咸鱼16 小时前
UE5 第一人称射击项目学习(二)
学习·ue5
暮志未晚Webgl16 小时前
109. UE5 GAS RPG 实现检查点的存档功能
android·java·ue5
心怀梦想的咸鱼16 小时前
UE5 第一人称射击项目学习(完结)
学习·ue5
暮志未晚Webgl2 天前
110. UE5 GAS RPG 实现玩家角色数据存档
java·前端·ue5
Zhichao_973 天前
【UE5】Slider控件样式
ue5
流行易逝3 天前
23.UE5删除存档
ue5
心怀梦想的咸鱼3 天前
UE5 第一人称射击项目学习(三)
学习·ue5
流行易逝3 天前
22.UE5控件切换器,存档列表,
ue5
[小瓜]4 天前
高级AI记录笔记(三)
人工智能·笔记·学习·ue5·虚幻
心怀梦想的咸鱼4 天前
UE5 5.1.1创建C++项目,显示error C4668和error C4067
ue5