Skip to content

Compiling On Windows

JoergAtGithub edited this page Mar 25, 2024 · 24 revisions

(If you're looking to make an installable release, go to this page.)

Building Mixxx on Windows

Note: These instructions are valid for Mixxx 2.3 onwards. You will find instructions for older release in the History of this wiki page.

Programs to install

Download Mixxx's source code

If you want to compile Mixxx, you'll need to download the source code. Source archives for releases are on downloads.mixxx.org, but if you want to contribute to Mixxx, we recommend forking the project. Check out Set up Git to get started.

Acquire Mixxx dependencies

To build Mixxx, you need built copies of its dependencies. Mixxx uses the VCPKG pacakge manager to build the dependencies (also called build environment or buildenv). this is maintained in the repo https://github.com/mixxxdj/vcpkg You may download pre-built versions of them from the Mixxx team (recommended) or build them from source.

Option 1: Download pre-built Mixxx dependencies automatically

The easiest option to get the built dependencies is to use the script located in MIXXX_REPO/tools/windows_buildenv.bat.

This script will download the appropriate file from Mixxx servers, and autogenerate a CMakeSettings.json file which can later be used to build Mixxx with the default settings from Visual Studio.

It will download the dependencies to MIXXX_REPO\buildenv\mixxx-deps-2.4-x64-windows-92b7b90.zip and extract the ZIP archive to a directory with the same name.

Option 2: Download pre-built Mixxx dependencies manually

You find the ZIP archives at: https://downloads.mixxx.org/dependencies/2.4/Windows/ The folder 2.?.x-windows contains build environments for the 2.? release of Mixxx. If you are working on the Main branch, always pick the latest version. If you want to work on a specific branch, pick the corresponding folder. Check the packaging/windows/build_environment file in the Mixxx codebase to see what version of the build environment is currently used for builds.

Download and unzip one of these environments. The current recommended folder is inside MIXXX_REPO\buildenv (example: MIXXX_REPO\buildenv\mixxx-deps-2.4-x64-windows-92b7b90).

Option 3: Compile Mixxx dependencies from source

If you want to build the Mixxx dependencies from source instead of downloading pre-built ones:

  1. Clone the Mixxx buildserver repository.
    Remember the folder to which the repository was saved.
  2. Github actions will build it automatically according the setup (including the list of dependencies) in https://github.com/mixxxdj/vcpkg/blob/2.4/.github/workflows/build.yml
  3. When Github Action finishes the build, you can download the buildenv as ZIP file from the artifacts.

The build will take some hours.

Build Mixxx

From Visual Studio

  1. If you have not run MIXXX_REPO/tools/windows_buildenv.bat, it is recommended to do so. It will also generate a CMakeSettings.json that is used by Visual Studio so you don't need to generate it manually.

  2. Open Visual Studio.

    It will ask to open a project, select open Folder and select MIXXX_REPO. It will detect it as a CMake project. You can also do so from File-Open->CMake... and select the CMakeLists.txt file from MIXXX_REPO.

    Select the correct build configuration on the toolbar. The CMakeSettings uses names like x64__portable and so on. Most likely, the one you want is x64_portable. By default it will also generate the CMake cache using the configuration. You can also run it manually (and clean and regenerate it) by selecting the CMakeLists.txt file, and use the options Generate cache or CMake cache -> delete cache.

  3. Go to Build-> Build All Menu option. The build should start. Depending on your processor, a full build can take from 5 to 20 minutes.

From commandline

  1. Open the application "x64 Native Tools command prompt for VS2019" from the Windows Start menu. There, go to MIXXX_REPO folder

  2. Create a folder where we will setup cmake and build the sources. Usually we call this MIXXX_REPO\build
    It is recommended that you actually create subfolders for different builds, as in:

    **MIXXX\_REPO**\build\x64__portable

    **MIXXX\_REPO**\build\x64__native

    **MIXXX\_REPO**\build\x64__off

    Do the same for the install subdir ( MIXXX_REPO\install\x64_portable)

  3. enter into this directory, cd build\x64__portable and type the following: cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="**MIXXX\_REPO**\buildenv;**MIXXX\_REPO**\buildenv\Qt-5.14.2" -DCMAKE_INSTALL_PREFIX=**MIXXX\_REPO**\install\x64_portable -DDEBUG_ASSERTIONS_FATAL=ON -DHSS1394=ON -DKEYFINDER=OFF -DLOCALECOMPARE=ON -DMAD=ON -DMEDIAFOUNDATION=ON -DSTATIC_DEPS=ON -DBATTERY=ON -DBROADCAST=ON -DBULK=ON -DHID=ON -DLILV=ON -DOPUS=ON -DQTKEYCHAIN=ON -DVINYLCONTROL=ON ..\..

You need to replace MIXXX_REPO\buildenv and MIXXX_REPO for your paths, as well as adapting the install subdir if you build a different one. Also, the last part of the command "..\.." means MIXXX_REPO as seen from the cmake build dir (in our case MIXXX_REPO\build\x64__portable, so two subfolders)

Finally, set -DDEBUG_ASSERTIONS_FATAL=OFF instead of ON if you get assertion errors that close Mixxx. This is intended to detect errors quickly, but might be completely unexpected sometimes.

  1. Once it completes without errors, you can type cmake --build . so that it starts building. Depending on your processor, a full build can take from 5 to 20 minutes.

In order to do a clean build, you can do so with cmake --build . --clean-first

Build 32bit version of Mixxx

32bit versions are no longer being built, so they might stop working at some point. Anyway, these are some instructions on how you can do that.

  1. Get the dependencies for 32bit: Either set the environment variable PLATFORM=x86 previous to execute the tools/windows_buildenv.bat script, or manually download the one for x86, or build it manually

  2. Follow the instructions to build from commandline, but instead open a x86 Native tools command prompt for VS2019 (or x86_64 cross compile command prompt for VS2019). (Preferably the latter)

WARNING: DO NOT mix 32 and 64 bits builds. Use separate console windows and separate precompiled directories and cmake build directories

Build debug version of Mixxx

  1. There are no precompiled environments for debug, so this means that you have to
    compile Mixxx dependencies from source as explained above. You will need to indicate this commandline to generate them in debug: build_environment xxx Debug
  2. Follow the instructions to build from commandline, but on the cmake instructions specify -DCMAKE_BUILD_TYPE=Debug instead of DCMAKE_BUILD_TYPE=Release.

WARNING: DO NOT mix release and debug builds. Use separate console windows and separate precompiled directories and cmake build directories

Clone this wiki locally