[UE5] VS2022: C1083 경로 이슈

seunghyun·2024년 3월 25일
2

UE 5

목록 보기
3/5

오류 메시지

Games\UE_5.3\GuardiansOrders\Source\GuardiansOrders\Character\GOCharacterBase.cpp(18): fatal error C1083: Cannot open include file: 'GOWidgetComponent.h': No such file or directory

fatal error C1083: Unable to open include file

헤더 파일 include 가 안되서 찾아보니, 경로 문제였다.

[UE5] C++ fatal error C1083: 포함 파일을 열 수 없습니다.

작업 중 기억해둘 것들(update).

위 블로그를 참고해서 아래와 같이 추가해준다.

using UnrealBuildTool;

public class GuardiansOrders : ModuleRules
{
	public GuardiansOrders(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG", "OnlineSubsystemSteam", "OnlineSubsystem", "NavigationSystem", "AIModule", "Niagara", "EnhancedInput", "CommonInput" });

        PrivateIncludePaths.Add("GuardiansOrders"); // 이거랑
        PublicIncludePaths.Add("GuardiansOrders"); // 이것
    }
}

위와 같이 해줬는데도 아래와 같은 오류가 뜬다면 ..!

Running D:/Epic Games/UE_5.3/Engine/Build/BatchFiles/Build.bat  -projectfiles -project="D:/Epic Games/UE_5.3/GuardiansOrders/GuardiansOrders.uproject" -game -rocket -progress -log="D:\Epic Games\UE_5.3\GuardiansOrders/Saved/Logs/UnrealVersionSelector-2024.03.26-11.38.51.log"
Using bundled DotNet SDK version: 6.0.302
Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" -projectfiles -project="D:/Epic Games/UE_5.3/GuardiansOrders/GuardiansOrders.uproject" -game -rocket -progress -log="D:\Epic Games\UE_5.3\GuardiansOrders/Saved/Logs/UnrealVersionSelector-2024.03.26-11.38.51.log"
Log file: D:\Epic Games\UE_5.3\GuardiansOrders\Saved\Logs\UnrealVersionSelector-2024.03.26-11.38.51.log
Log file: C:\Users\redna\AppData\Local\UnrealBuildTool\Log_GPF.txt

Some Platforms were skipped due to invalid SDK setup: IOS, Android, Linux, LinuxArm64.
See the log file for detailed information

Generating VisualStudio2022 project files:
Discovering modules, targets and source code for project...
Compiled assembly file 'D:\Epic Games\UE_5.3\GuardiansOrders\Intermediate\Build\BuildRules\GuardiansOrdersModuleRules.dll' appears to be for a newer CLR version or is otherwise invalid.  Unreal Build Tool will try to recompile this assembly now.  (Exception: Could not load file or assembly 'D:\Epic Games\UE_5.3\GuardiansOrders\Intermediate\Build\BuildRules\GuardiansOrdersModuleRules.dll'. Format of the executable (.exe) or library (.dll) is invalid.)
D:\Epic Games\UE_5.3\GuardiansOrders\Source\GuardiansOrders\GuardiansOrders.Build.cs(13,9): error CS0103: The name 'PrivateIncluePaths' does not exist in the current context
D:\Epic Games\UE_5.3\GuardiansOrders\Plugins\MultiplayerSessions\Source\MultiplayerSessions\MultiplayerSessions.Build.cs(59,9): error CS0103: The name 'PrivateIncluePaths' does not exist in the current context
Expecting to find a type to be declared in a target rules named 'GuardiansOrdersTarget'.  This type must derive from the 'TargetRules' type defined by Unreal Build Tool.

재부팅 후 아래 항목을 삭제한 후 VS 프로젝트 파일을 Generate 해주면 된다.

.vs

Binaries

DerivedDataCache

Intermediate

Saved

.vsconfig

~.sln요

그러면 이렇게 잘 include 된다!

0개의 댓글