> For the complete documentation index, see [llms.txt](https://docs.proudnet.com/proudnet.eng/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.eng/proudnet/2.setting/mac-xcode.md).

# Mac Xcode

> ProudNet iOS version
>
> * Development languages: C/C++
> * Library and Sample: XCode8 Version

***

## 1.  Preparation Work

Below shows how to include ProudNet Library in your XCode Project.

1-1. Copy the files below to your Mac

<figure><img src="/files/o90nLTy8e0g0do6iLzFO" alt=""><figcaption><p>Copied files and paths</p></figcaption></figure>

> * ProudNet\Sample\Chat\ChatCommon
> * ProudNet\Sample\Chat\ChatIOS
> * ProudNet\lib\IOS\LLVM(or GNU)
> * ProudNetProudNet\utill\PIDL.exe

1-2. Install Mono for Mac.

{% hint style="success" %}
**Reference**

[**Install Mono for Mac**](https://www.mono-project.com/docs/getting-started/install/mac/)
{% endhint %}

1-3. open <mark style="color:orange;">ChatIOS.xcodeproj</mark> in <mark style="color:orange;">Sample\ChatIOS</mark>&#x20;

1-4. Add <mark style="color:orange;">Include.xcodeproj</mark> to your project.

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

1-5. Modify the contents of the Run Script for <mark style="color:orange;">BuildPhases</mark>.

1-6. Modify Debug, Relese in <mark style="color:orange;">Build Settings > Other Linker Flags</mark>.

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

Change to the path where the actual <mark style="color:orange;">libProudNetClient.a</mark> is located, and choose between LLVM and GNU. If you have a directory structure like the one above, it should look like the screenshot.

1-7. To check, after building ChatIOS, you can run ChatServer on Windows to check for ChatIOS connectivity.

{% hint style="danger" %}
**Notes on using ProudNet in Xcode**\
※  Add <mark style="color:orange;">libiconv.dylib</mark>, a library built in Xcode.\
※ It is not available in m-files, so you need to change the extension to mm-files.\
※ Add <mark style="color:orange;">#include \<new></mark> to all mm files. In Xcode, STLs cannot be declared in header files.
{% endhint %}

## 2. Resolving errors

### - Link error when adding ProudNet Library

If you experience a link error when adding the ProudNet Library, add the following option.

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

### - Link error with duplicate symbol when using the <mark style="color:orange;">-all\_load -Objc</mark> option

If <mark style="color:orange;">COCOs2d-x</mark>, a link error related to duplicate symbol, occurs when using the <mark style="color:orange;">-all\_load -Objc</mark> option, use <mark style="color:orange;">-force\_load</mark> instead of <mark style="color:orange;">-all\_load -Objc</mark> in <mark style="color:orange;">Other Linker Flags</mark>.

<figure><img src="/files/caxS0lo0F8Ib5HJcVMeI" alt=""><figcaption><p>Example of using the -force_load option</p></figcaption></figure>

To match the path, adjust the path to <mark style="color:orange;">PIDL.exe</mark>. If the directory structure is as above, please modify it as follows. <mark style="color:orange;">mono ../../util/PIDL.exe ../ChatCommon/\* -outdir ./ChatIOS/</mark>

***

## :arrow\_left: [<mark style="color:blue;">Back</mark>](https://docs.proudnet.com/proudnet.eng/proudnet/2.setting/pages/YF7Z3CPCxDI0T1hoMsHR#id-1.-set-up-your-project)


---

# 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:

```
GET https://docs.proudnet.com/proudnet.eng/proudnet/2.setting/mac-xcode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
