윈도우 계열의 일부 라이브러리를 사용할 경우,
언리얼에서 정의된 값들 간의 이름 충돌 방지를 위해
헤더 추가지점과 외부 헤더에 정의된 값을 사용하는 코드의 앞뒤를 특수한 헤더로 감싸주어야 한다.
그렇지 않을 경우 링커 관련 에러가 발생할 수 있다.
// Socket.h
#include <WinSock2.h>
// (코드)
// 에러 발생
// Socket.h
#include "Windows/AllowWindowsPlatformTypes.h"
#include "Windows/prewindowsapi.h"
#include <WinSock2.h>
// (코드)
#include "Windows/PostWindowsApi.h"
#include "Windows/HideWindowsPlatformTypes.h"
또 AllowWindowsPlatformTypes.h는 Nested 되어서는 안되기 때문에,
외부 헤더를 사용하는 다른 헤더를 include할 때 nested 되지 않게 주의하자.
'game engines > Unreal Engine' 카테고리의 다른 글
[UE5] Standalone Playmode에서 빌드가 업데이트가 안되는 경우 (0) | 2023.08.22 |
---|---|
[UE5] exception_access_violation writing address 0x0000000000000000 (0) | 2023.08.22 |
[UE5] Could not be compiled, Try rebuilding ... (0) | 2023.08.17 |
[UE5] MSB3073 에러 (0) | 2023.08.17 |
< 안내글 > (0) | 2022.05.03 |