Visual Studio 2022 and later
Building Artistic Style with Visual Studio
Following are instructions for installing Visual Studio 2022 or later and compiling Artistic Style for the Win32 and x64 platforms. The free Community edition is sufficient. Unlike the former Express editions, it contains the 64-bit compilers and the Windows SDK, so no separate SDK install is needed.
Installing Visual Studio
Download the Visual Studio installer and select the workload Desktop development with C++. It installs the MSVC compiler for x86 and x64 and a current Windows SDK. Optional components are:
- C++ CMake tools for Windows to build with CMake instead of the solution files.
- MSVC ARM64/ARM64EC build tools (under "Individual components") to compile for Windows on ARM.
Components can be added later by running the Visual Studio Installer again and selecting "Modify".
Using the Artistic Style Solution Files
The solution files are in the "build" directory:
- build\vs2022 for Visual Studio 2022 (platform toolset v143)
- build\vs2026 for Visual Studio 2026 (platform toolset v145)
Open a solution, select the configuration (Debug, Release or Static) and the platform (Win32 or x64) in the toolbar, and build. Win32 output is placed in the "debug", "bin" and "binstatic" directories, x64 output in the same directories below "x64". The solutions are described in the Install Information.
A newer Visual Studio release can open the solution of an older one. If the older platform toolset is not installed, use "Project > Retarget solution" to switch to the installed toolset.
Building from the Command Line
Open the "x64 Native Tools Command Prompt" or the "Developer PowerShell" from the Start menu and run MSBuild on a solution:
cd build\vs2022 msbuild "AStyle 2022.sln" /p:Configuration=Release /p:Platform=x64
CMake can generate Visual Studio projects as well. Use the generator "Visual Studio 17 2022" or "Visual Studio 18 2026" (this needs a CMake release that supports it):
cmake -B build-msvc -G "Visual Studio 17 2022" -A x64 cmake --build build-msvc --config Release
Adding a Platform to Your Own Project
New C++ projects already contain the Win32 and x64 platforms. To add a platform (e.g. ARM64) to an existing project, open "Build > Configuration Manager", select "<New...>" in "Active solution platform", choose the new platform, copy the settings from an existing platform and check "Create new project platforms".
To keep the output of the platforms apart, include the $(Platform) macro in "Configuration Properties > General > Output Directory", e.g. $(SolutionDir)$(Platform)\$(Configuration)\. The default Intermediate Directory already contains it.