MiniUPNPc module is included as part of TeleNVDA to forward ports and ease the creation of a direct connection server. Due to the complexity of the building process, prebuilt binaries are available on the add-on source. This document explains how to build them yourself in case you want to recreate the process. If you find a way to automate it while building the add-on, feel free to open a pull request.
You will need the following components:
- Python, versions 3.7 and 3.11 for x86, with setuptools package installed.
- Visual Studio 2022 with the latest Windows SDK and MSVC toolchain for x86 installed.
- CMake. You can install it as a Visual Studio component.
- Git for Windows or similar.
- Clone MiniUPNP Git repository:
git clone https://github.com/miniupnp/miniupnp.git - Checkout the tag for the latest release. For example:
git checkout miniupnpd_2_3_9 - Open the 'x86 Native Tools Command Prompt for VS 2022' and navigate to the 'miniupnpc' subfolder inside the cloned repository.
- Generate solution and project files compatible with vs2022. They will be written to the 'output' folder:
cmake -B output -G "Visual Studio 17 2022" -A Win32 - Build the projects in release mode:
cmake --build output --config Release - Copy output/release/libminiupnpc.lib to the current directory, renaming it as miniupnpc.lib:
copy output\Release\libminiupnpc.lib miniupnpc.lib - Build a static Python 3.11 module which won't require extra dlls to work:
py -3.11-32 setupmingw32.py build - Do the same on Python 3.7:
py -3.7-32 setupmingw32.py build - Copy the generated files to the add-on source. They can be found on build/lib.win32-cpython-311 and build/lib.win32-3.7, respectively.
- That's all, enjoy! Did you expect more steps?