> For the complete documentation index, see [llms.txt](https://docs.proudnet.com/proudnet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.proudnet.com/proudnet/proudnet/2.setting/unreal-engine-4.md).

# Unreal Engine 4

## 1. UE4 프로젝트 생성

1-1. UE4 Editor를 실행시킨 창에서 <mark style="color:orange;">게임</mark> 을 선택하고, <mark style="color:orange;">프로젝트 열기</mark> 버튼이 <mark style="color:orange;">다음</mark> 으로 바뀌면, <mark style="color:orange;">다음</mark> 버튼을 누릅니다.

<figure><img src="/files/Q7FaMy3cFZrZUlF1sHup" alt=""><figcaption><p>UE4 Editor를 실행 후 발생한 창</p></figcaption></figure>

#### 1-2. <mark style="color:orange;">템플릿 선택</mark> 창에서 <mark style="color:orange;">기본</mark>을 선택 후, <mark style="color:orange;">다음</mark>을 누릅니다.

<figure><img src="/files/geZbCKfFlc1gFDrEkIv9" alt=""><figcaption></figcaption></figure>

#### 1-3. <mark style="color:orange;">프로젝트 세팅</mark>에서 <mark style="color:orange;">블루프린트</mark> 버튼을 클릭하면 버튼이 드롭 다운 리스트로 펼쳐집니다.

<figure><img src="/files/0t3yRahrXGJ3i5yrC1n2" alt=""><figcaption></figcaption></figure>

#### 1-4. 펼쳐진 드롭다운 리스트에서 아래 스크린샷과 같이 C++를 선택합니다.

<figure><img src="/files/BcTpt8hXMNSxgSB5VK9j" alt=""><figcaption></figcaption></figure>

#### 1-5. 아래 빨간 박스로 표시된 <mark style="color:orange;">프로젝트 경로 창</mark>과 프로젝트명 창에 프로젝트를 생성할 경로와 생성할 프로젝트명을 입력하시고, <mark style="color:orange;">프로젝트 생성</mark>을 누릅니다.

<figure><img src="/files/GP1Wp8lnYuwH9Vivx8xo" alt=""><figcaption></figcaption></figure>

#### 1-6. 프로젝트 생성이 끝나면, 생성된 프로젝트로 Visual Studio IDE와 UE4 Editor가 동시에 실행되어집니다.

#### 1-7. Visual Studio IDE에서 Configuration과 Platform을 반드시 아래와 같이 지정하시고 작업을 진행하셔야 됩니다.

{% hint style="info" %}

* Solution Configuration : <mark style="color:orange;">Development Editor</mark>
* Solution Platform : <mark style="color:orange;">Win64</mark>
  {% endhint %}

## 2. UE4 프로젝트에 ProudNet 연동하기

<mark style="color:orange;">(프로젝트명).build.cs</mark> 파일에 C# 코드로 ProudNet 라이브러리와 헤더 파일 경로를 지정하세요.

> 1. cs 파일을 열어 UE4 Editor가 자동 생성한 프로젝트명과 동일한 class가 있을 것입니다. 클래스는 현재 생성자만 가지고 있는 상태입니다.
> 2. 생성자의 body를 보시면, 뒷 부분에 주석이 몇 줄 달려있는 것을 보실 수 있습니다. 그 주석 뒤편에 ProudNet 라이브러리와 헤더 파일 참조 경로를 지정하는 코드를 넣으시면 됩니다.
> 3. ProudNet 라이브러리 참조 경로 지정은 <mark style="color:orange;">PublicAdditionalLibraries</mark> 객체의 Add 함수로 라이브러리 경로 문자열을 넘기시면 됩니다.\
>    예: **> PublicAdditionalLibraries.Add("D:\ProudNet1.7.48971-master\ProudNet\lib\x64\v140\Release\ProudNetClient.lib")**
> 4. ProudNet 헤더 파일 참조 경로 지정은 <mark style="color:orange;">PublicIncludepaths</mark>라는 전역 객체의 Add 함수로 ProudNet include 폴더의 경로를 넘기시면 됩니다.\
>    예: **> PublicIncludePaths.Add("D:\ProudNet1.7.48971-master\ProudNet)**
> 5. 프라우드넷을 연동시키는 UE4 프로젝트는 반드시 64비트로 빌드 되어야 하므로, 앞서 작성한 두 문장을 중괄호로 감싼 뒤 위에 if 문을 붙여줍니다.&#x20;
> 6. IOS 및 Android 빌드 시 필요한 lib 파일들 또한 if 문으로 감싼 뒤 작성합니다.

아래는 주석 처리를 지우고 작성한 예시입니다.

{% code overflow="wrap" lineNumbers="true" fullWidth="false" %}

```cpp
// Copyright Epic Games, Inc. All Rights Reserved.
 
using System.IO;
using UnrealBuildTool;
 
public class TestUnreal4 : ModuleRules
{
    public TestUnreal4(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
    
        PublicIncludePaths.AddRange(
	new string[] {
	    // ... add public include paths required here ...
	}
	);
				
		
	PrivateIncludePaths.AddRange(
	new string[] {
	    // ... add other private include paths required here ...
	}
	);
 
        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            // Add the import library
            PublicAdditionalLibraries.Add(@"D:\ProudNet1.8.00002-master\ProudNet\lib\x64\v140\Release\ProudNetClient.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PublicAdditionalLibraries.Add(@"D:\ProudNet1.8.00002-master\ProudNet\lib\x64\v140\Release\libProudNetClient.a");
            
            PublicAdditionalLibraries.Add(@"D:\ProudNet1.8.00002-master\ProudNet\lib\x64\v140\Release\libiconv.2.tbd"));
        }
        else if(Target.Platform == UnrealTargetPlatform.Android)
        {
        PublicAdditionalLibraries.Add(@"D:\ProudNet1.8.00002-master\ProudNet\lib\NDK\r20\cmake\clangRelease\arm64-v8a\libProudNetClient.a);
        }
        
         PublicIncludePaths.Add(@"D:\ProudNet1.7.48971-master\ProudNet\include");
    }
}
```

{% endcode %}

{% hint style="warning" %}
iOS 및 Android 는 <mark style="color:orange;">ProudNet\lib\x64\v140\Release\libProudNetClient.lib</mark> 대신<mark style="color:orange;">ProudNet\lib\NDK\r20\cmake\clangDebug\arm64-v8a\libProudNetClient.a</mark> 를 참조하게 합니다.
{% endhint %}

{% hint style="danger" %}
위 예시 코드의 경로로 설정하지 마시고 실제 프라우드넷이 설치된 경로의 경로를 입력해 주세요.
{% endhint %}

<figure><img src="/files/TBQ9pg0OrxY9FLNj3M9i" alt=""><figcaption></figcaption></figure>

위의 예시처럼 컴파일 에러 없이 정상적으로 <mark style="color:orange;">CNetClient</mark>를 생성할 수 있습니다.

## 3. Android 빌드

아래의 링크를 참조해 주십시오.

{% hint style="success" %}
**참고**

[**Android 퀵스타트**](https://docs.unrealengine.com/5.3/ko/setting-up-unreal-engine-projects-for-android-development/)
{% endhint %}

## 4. iOS 빌드

{% hint style="warning" %} <mark style="color:orange;">libiconv.2.tbd</mark> 라이브러리의 경로를 추가적으로 지정해 주어야 합니다.&#x20;

지정해 주지 않으면 빌드 시 iconv 관련 링크 에러가 발생합니다.
{% endhint %}

<figure><img src="/files/caO9n452h46hPgQYuJH7" alt=""><figcaption></figcaption></figure>

아래 링크를 참조해 주십시오.

{% hint style="success" %}
**참고**

[**iOS 퀵스타트 가이드**](https://docs.unrealengine.com/5.3/ko/setting-up-an-unreal-engine-project-for-ios/)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.proudnet.com/proudnet/proudnet/2.setting/unreal-engine-4.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
