# \[Windows]\[VC2022]\[CMake] Compiling OTClientV8 Sources

## **1 - Downloads Required:**

* &#x20;**Visual Studio 2022 Community:** <https://visualstudio.microsoft.com/pt-br/thank-you-downloading-visual-studio/?sku=Community&rel=17>
* &#x20;**Microsoft Visual C++ Redistributable 2015-2022:** ([32-bit download](https://aka.ms/vs/17/release/vc_redist.x86.exe), [64-bit download](https://aka.ms/vs/17/release/vc_redist.x64.exe))
* &#x20;**Git:** <https://git-scm.com/download/win>

## **2 - Visual Studio 2022:**

* &#x20;On the Visual Studio home screen, in the Visual Studio Community 2022 product click the Install button.
* &#x20;On the next screen, select Desktop Development with C++.
* &#x20;On the same screen under Installation Details, select:
* ![](broken-reference)
* &#x20;Then in Language Packs, select:
* ![](broken-reference)

## **3 - Install the necessary software:**

* &#x20;Install Git.

## **4 - VCPKG:**

<details>

<summary><strong>If you don't have vcpkg installed</strong></summary>

&#x20;Use **Powershell in directory** **C:**

* cd C:\\

• To complete vcpkg installation, run the commands below in **Powershell**:

* git clone <https://github.com/microsoft/vcpkg>
* cd vcpkg
* .\bootstrap-vcpkg.bat
* .\vcpkg integrate install

</details>

<details>

<summary>If you already have vcpkg installed</summary>

Use **Powershell in directory** **C:**

* cd C:\vcpkg

• To update vcpkg installation, run the commands below in **Powershell**:

* git pull
* .\vcpkg upgrade
* .\vcpkg upgrade --no-dry-run
* .\bootstrap-vcpkg.bat

</details>

## 5 - Integration of VCPKG into Visual Studio:

* Execute the following command in **Powershell** with **Administrator permission** to set vcpkg environment variable:

{% hint style="info" %}
\[System.Environment]::SetEnvironmentVariable('VCPKG\_ROOT','C:\vcpkg', \[System.EnvironmentVariableTarget]::Machine)
{% endhint %}

## **6 - OTClientV8 Sources:**

* &#x20;Download **OTClientV8** sources with the command below in **Powershell:**

{% hint style="info" %}
cd C:\\\
git clone --recursive <https://github.com/opentibiabr/otcv8.git>
{% endhint %}

## **7 - Compiling OTClientV8 Sources:**

* &#x20;Open Visual Studio 2022, in the "Get Started" window, select "Open the local folder" and open the otclient root folder.
* &#x20;Wait for the Visual Studio to load. It will automatically install the libraries and generate the cmake cache. (Be patient, the first cache may take a few minutes).
* &#x20;After the cmake cache is successfully generated, you can compile the otclient by going to the **Build > Build All menu**.&#x20;
* &#x20;After build, the executable is automatically copied to the otclient main folder.

## **8 - How to connect with OTClientV8:**

* [Canary](https://docs.opentibiabr.com/opentibiabr/projects/otclientv8#how-to-connect-on-canary-with-otclientv8)

## **9 - Credits:**

**Kondra, Oen, vithrax (OTClientv8)**

**Majesty (OTClient tutorial on VS2022)**

**Microsoft - VCPKG:** <https://github.com/Microsoft/vcpkg>
