> For the complete documentation index, see [llms.txt](https://qpapel.papelship.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://qpapel.papelship.com/documentation/tr-documentation/proje-ayarlama/installation.md).

# Installation

Complete guide to integrate qPapel Auth library into your Visual Studio C++ project.

{% hint style="info" %}
This library requires Windows 10/11 (x64) and Visual Studio 2019 or later.
{% endhint %}

## Requirements

| Requirement      | Version                        |
| ---------------- | ------------------------------ |
| Operating System | Windows 10/11 (x64)            |
| IDE              | Visual Studio 2019 or later    |
| C++ Standard     | C++17 or later                 |
| Network          | Internet connectivity required |

## Download Library & Tool Files

You will need to retrieve the following components:

* **Static SDK Files**: You will receive the `qPapelLib.h`, `qPapelLib.lib`, and `libsodium.lib` files to link in your application.
* **Authentication DLL**: Download **qPapelAuth64.dll** from your Web Dashboard downloads page: [papelship.com/dashboard/downloads](https://papelship.com/dashboard/downloads).
* **Packer Tool**: You will receive **qPapelPacker.exe** inside the tools folder to inject your authentication DLL.

{% tabs %}
{% tab title="Header File" %}
**qPapelLib.h**

* Main library header
* Contains all function declarations and ergonomic C++ namespace wrapper
* Place in your Include directory
  {% endtab %}

{% tab title="Library Files" %}
**qPapelLib.lib**

* Compiled static library (links with your project)
* Place in your Lib directory

**libsodium.lib**

* Compiled static library (libsodium dependency)
* Place in your Lib directory
  {% endtab %}

{% tab title="Tools" %}
**qPapelTools/**

* **qPapelPacker.exe**: Hardened section injector tool.
* **qPapelAuth64.dll**: Downloaded from the dashboard, placed here.
* Place this entire folder in your project root.
  {% endtab %}
  {% endtabs %}

## Project Setup

{% stepper %}
{% step %}

### Create Project Structure

Create the following folder structure in your project:

```
YourProject/
├── Include/
│   └── qPapelLib.h
├── Lib/
│   ├── qPapelLib.lib
│   └── libsodium.lib
├── qPapelTools/
│   ├── qPapelPacker.exe
│   └── qPapelAuth64.dll  <-- Downloaded from papelship.com/dashboard/downloads
└── Source/
    └── main.cpp
```

{% endstep %}

{% step %}

### Configure Include Directory

{% tabs %}
{% tab title="Visual Studio GUI" %}

1. Right-click your project in **Solution Explorer**
2. Select **Properties**
3. Navigate to **Configuration Properties → C/C++ → General**
4. Click **Additional Include Directories**
5. Add your Include folder path:

   ```
   $(ProjectDir)Include
   ```

   Or absolute path:

   ```
   C:\MyProject\Include
   ```
6. Click **OK**
   {% endtab %}

{% tab title="Project File (.vcxproj)" %}
Add to your `.vcxproj` file:

```xml
<ItemDefinitionGroup>
  <ClCompile>
    <AdditionalIncludeDirectories>$(ProjectDir)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  </ClCompile>
</ItemDefinitionGroup>
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### Configure Library Directory

{% tabs %}
{% tab title="Visual Studio GUI" %}

1. In **Properties**, navigate to **Configuration Properties → Linker → General**
2. Click **Additional Library Directories**
3. Add your Lib folder path:

   ```
   $(ProjectDir)Lib
   ```

   Or absolute path:

   ```
   C:\MyProject\Lib
   ```
4. Click **OK**
   {% endtab %}

{% tab title="Project File (.vcxproj)" %}
Add to your `.vcxproj` file:

```xml
<ItemDefinitionGroup>
  <Link>
    <AdditionalLibraryDirectories>$(ProjectDir)Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  </Link>
</ItemDefinitionGroup>
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### Link the Library

{% tabs %}
{% tab title="Visual Studio GUI" %}

1. In **Properties**, navigate to **Configuration Properties → Linker → Input**
2. Click **Additional Dependencies**
3. Add:

   ```
   qPapelLib.lib
   libsodium.lib
   ```
4. Click **OK**
   {% endtab %}

{% tab title="Project File (.vcxproj)" %}
Add to your `.vcxproj` file:

```xml
<ItemDefinitionGroup>
  <Link>
    <AdditionalDependencies>qPapelLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
  </Link>
</ItemDefinitionGroup>
```

{% endtab %}

{% tab title="Code (Pragma)" %}
Add to your source file:

```cpp
#pragma comment(lib, "qPapelLib.lib")
#pragma comment(lib, "libsodium.lib")
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### Set C++ Standard

{% hint style="warning" %}
The library requires C++17 or later.
{% endhint %}

1. In **Properties**, navigate to **Configuration Properties → C/C++ → Language**
2. Set **C++ Language Standard** to **ISO C++17 Standard (/std:c++17)** or later
3. Click **OK**
   {% endstep %}

{% step %}

### Configure Post-Build Event (Packer Automation)

{% hint style="warning" %}
Your compiled executable must be processed by `qPapelPacker.exe` to inject `qPapelAuth64.dll` as a secure `.qpdata` section, otherwise `qpapel::Init()` will fail.
{% endhint %}

1. In **Properties**, navigate to **Configuration Properties → Build Events → Post-Build Event**
2. Set **Command Line** to:

   ```cmd
   if not exist "$(ProjectDir)dist" mkdir "$(ProjectDir)dist"
   "$(ProjectDir)qPapelTools\qPapelPacker.exe" --dll "$(ProjectDir)qPapelTools\qPapelAuth64.dll" --input "$(OutDir)$(TargetName)$(TargetExt)" --output "$(ProjectDir)dist\$(TargetName)_final_x64.exe"
   ```
3. Set **Description** (or Message) to:

   ```
   Embedding qPapelAuth DLL into target executable...
   ```
4. Click **OK**
   {% endstep %}
   {% endstepper %}

## Verify Installation

Create a test file to verify the setup:

```cpp
#include <iostream>
#include "qPapelLib.h"

int main() {
    if (!qpapel::Init()) {
        std::cout << "Core stub initialization failed." << std::endl;
        return 1;
    }
    std::cout << "qPapel Auth library loaded successfully!" << std::endl;
    return 0;
}
```

{% tabs %}
{% tab title="Build" %}
Press **F7** or click **Build → Build Solution**

Expected output:

```
Build succeeded.
```

{% endtab %}

{% tab title="Run" %}
Press **Ctrl+F5** or click **Debug → Start Without Debugging**

Expected output:

```
qPapel Auth library loaded successfully!
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
If you see the success message, installation is complete!
{% endhint %}

## Troubleshooting

<details>

<summary>Error: Cannot open include file 'qPapelLib.h'</summary>

**Cause:** Include directory not configured correctly

**Solutions:**

1. Verify `qPapelLib.h` exists in Include folder
2. Check Include path in project properties
3. Use absolute path if relative path doesn't work
4. Ensure path has no typos

**Verify:**

```cpp
// This should work after fixing
#include "qPapelLib.h"
```

</details>

<details>

<summary>Error: Unresolved external symbol</summary>

**Cause:** Library not linked properly

**Solutions:**

1. Verify `qPapelLib.lib` and `libsodium.lib` exist in Lib folder
2. Check Lib path in project properties
3. Ensure library is added to Additional Dependencies
4. Check platform is x64 (not x86)

**Verify in Linker settings:**

* Additional Library Directories: Contains Lib path
* Additional Dependencies: Contains `qPapelLib.lib` and `libsodium.lib`

</details>

<details>

<summary>Error: LNK1104 cannot open file</summary>

**Cause:** Library file not found

**Solutions:**

1. Check library file exists at specified path
2. Verify filename is exactly `qPapelLib.lib`
3. Check for extra spaces in path
4. Use absolute path

</details>

<details>

<summary>Error: C++ standard not supported</summary>

**Cause:** C++ standard is below C++17

**Solutions:**

1. Open project properties
2. Go to C/C++ → Language
3. Set C++ Language Standard to `/std:c++17` or later
4. Rebuild project

</details>

<details>

<summary>Platform mismatch (x86 vs x64)</summary>

**Cause:** Project platform doesn't match library

**Solutions:**

1. Library is compiled for **x64**
2. Set your project platform to **x64**:
   * Build → Configuration Manager
   * Active solution platform → x64
3. Rebuild project

</details>

## Configuration for Release Build

{% hint style="info" %}
The same setup works for both Debug and Release configurations.
{% endhint %}

To configure for Release:

1. Switch to **Release** configuration
2. Repeat Steps 2-4 above
3. Or select **All Configurations** in Properties to apply to both

## Next Steps

{% hint style="success" %}
Installation complete! Now configure your API keys.
{% endhint %}

* Configuration - Get your API keys from dashboard
* Quick Start - Start using the library
* Complete Example - Full application example
