# C++

## How to Build and Run C++ Samples

## General Samples

1. Under the `samples` directory, there is a folder structure "SampleName\PlatformName", which contains the sample files. Open the `.sln` file in each folder using Visual Studio.
2. Specify the command arguments in `Project > Properties > Debug > Command Arguments`.

   ```
    $(endPoint) $(uid) $(clientKey) e.g. 192.168.XXX.XXX:7000 2222 5599933
   ```
3. Build and run using F5. The execution status will be displayed in the output window.
4. When executing multiple clients, run multiple clients in separate processes from a terminal, such as the Windows Command Prompt.

   ```
   > .\x64\Debug\matchmaker_ticket.exe $(endPoint) $(uid) $(clientKey)
   e.g. matchmaker_ticket.exe 192.168.XXX.XXX:7000 2222 5599933
   ```

## Building Samples for iOS Simulator

1. In Xcode, verify `Product` > `Destination` > `Destination Architectures` > `Show Rosetta Destinations`.
2. Click the run destination on the top bar and select the Rosetta simulator.
3. Open `Build Settings` > `Search Paths`.
4. Adjust the order of search paths so that `../../../platforms/ios/iOS-Simulator/lib_static` is prioritized.

## Running Android Samples

1. Right-click on the project in Visual Studio and open `Properties`.
2. Navigate to `Debugging`.
3. Set the launch arguments in `Launch Flags`. Specify the arguments with the `--es` option (intent arguments).
4. e.g.

   ```
   --es host 192.168.55.117:7000 --es uid 1111 --es clientKey AAAA
   ```


---

# Agent Instructions: 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://help.diarkis.io/en/diarkis-client/samples/cpp.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.
