If you don’t want to install Microsoft’s Visual Studio due to some issues, but you still need to build Dandelion on a Windows physical machine (Windows is probably the most commonly used system), you can refer to this tutorial, use the correct approach to set up the environment, and avoid strange problems.
- Benefits of building with Visual Studio:
- The installation is graphical, straightforward, and gets installed in one go.
- Native compiler, reduces potential issues on Windows. Dependency‑library detection won’t fail on the OS, lowering the chance of errors.
- Faster compilation speed.
- Benefits of building with mingw‑w64:
- Generally takes up less disk space than Visual Studio, and it’s a portable software, convenient for installation and migration.
- Consistent with the compilers and commands of modern Linux systems, helpful for learning Linux.
- It’s free software, not tied to Microsoft’s Visual Studio.
First, obtain the latest mingw‑w64 toolchain (GCC 14 / Clang 18). The recommended way is to use msys2, do not use compilers that come with software such as Dev‑C++ or Code::Blocks; those are too old, the compiler versions are outdated, and you will definitely encounter problems. The acquisition steps are as follows:
- Visit the msys2 website, click
Download the installer: msys2-x86_64-xxxx.exeto download the latest installer. - Follow the website’s tutorial to install it to the root directory of a drive.
- Open the msys2 terminal, recommended to use the clang64 environment
- In short, this environment uses the clang compiler to compile native Windows programs; the opened terminal is bash, which is a Linux‑like environment, and cmd/PowerShell cannot access it directly.
- Install some required packages in the environment:
- Run
pacman -S gitto install git - Run
pacboy -S toolchain:pto install the clang toolchain - Run
pacboy -S cmake:p ninja:pto install the build tools CMake and ninja; ninja and make have the same functionality and can be replaced with make
- Run
Second, use git clone to download the dandelion code, checkout to the v1.1.0 version (or the corresponding static‑library version), and follow the documentation to place the static library correctly, because we are using clang, the static library should also be the clang version.
Finally, follow the Linux‑version build process using cmake; no additional steps should be needed. If nothing goes wrong, it should compile successfully.
There are many tutorials online on how to debug programs compiled in the Clang64 environment using VS Code, and how to add a Clang64 environment terminal, so we won’t elaborate further. For example, the CodeLLDB extension.