| 1 | \page buildwindows Building on Windows |
| 2 | |
| 3 | To build on Windows follow these steps *exactly*. The build process depends on specific libraries being installed on your system in specific locations. |
| 4 | |
| 5 | ## Wait a minute! Read this first! |
| 6 | |
| 7 | \warning **You do not need to follow this tutorial unless you plan to contribute to or modify the library itself**. Unless you consider yourself an **advanced user** with a specific **requirement to build from source** you should [obtain a pre-made Visual Studio template containing the latest D++ build (for 32 and 64 bit, release and debug profiles) by clicking here](https://github.com/brainboxdotcc/windows-bot-template/) and completely skip this guide! Instead, read \ref build-a-discord-bot-windows-visual-studio. |
| 8 | |
| 9 | ## If you are absolutely sure you need this guide, read on: |
| 10 | |
| 11 | 1. Make sure you have Visual Studio 2019 or Visual Studio 2022. The Community, Professional or Enterprise versions all work, however you will probably want to install Community. You do **NOT** want to use *Visual Studio Code* for this. You can [download the correct version here](https://visualstudio.microsoft.com/downloads/). |
| 12 | 2. Check out the D++ project source using Git |
| 13 | 3. From within Visual Studio 2019, click the "File" menu, choose "Open" then "CMake", and select the `CMakeLists.txt` within the project folder |
| 14 | \image html winbuild_1.png |
| 15 | \image html winbuild_2.png |
| 16 | 4. Go to the "Build" menu and choose "Build all" or just press F7 |
| 17 | \image html winbuild_3.png |
| 18 | 5. Check that compilation succeeded. You may now use the library in your projects! |
| 19 | \image html winbuild_4.png |
| 20 | |
| 21 | ## Troubleshooting |
| 22 | |
| 23 | * If you do not have an option to open the `CMakeLists.txt`, ensure that you have installed the C++ development portions of Visual Studio (not just web development portions) with at least the default options. |
| 24 | * If the project does not build, please ask for help on the [official Discord server](https://discord.gg/dpp). |
| 25 | |
| 26 | ## After compiling |
| 27 | |
| 28 | After compilation you can directly reference the compiled project in your own `CMakeLists.txt` as a library or use the `lib/dll/headers` as you wish. Note that `openssl` and `zlib` will also be an indirect dependency of your program (as `DLL` files) and should be copied alongside `dpp.dll`. |
| 29 | |
| 30 | **Have fun!** |