개발일지/UE4

UE4 Xcode build error : variable “LayerNames” set but not used [-Werror,-Wunused-but-set-variable]

김진우 개발일지 2023. 8. 18. 11:24

[velog에서 블로그 이전하며 가져온 글입니다]

작성 일자 : 2022년 11월 30일

출처 : https://velog.io/@hon454/Unreal-macOS-에서-빌드-시-variable-LayerNames-set-but-not-used-Werror-Wunused-but-set-variable-에러가-발생하는-경우

MacOS 환경에서 XCode로 UE4 프로젝트를 빌드할 때 아래 에러가 나온다.

variable “LayerNames” set but not used [-Werror,-Wunused-but-set-variable]

해결책은 *.build.cs 파일에 아래 코드를 삽입해주는 것이다.

bOverrideBuildEnvironment = true;
AdditionalCompilerArguments = "-Wno-unused-but-set-variable";

참고 : 언리얼 포럼