Skip to content

Install the Prerequisites

ReenigneArcher edited this page Oct 15, 2024 · 26 revisions

This is part of the Getting Started guide. Please read the full guide if you have trouble.


You will need the following tools:

You will find platform specific instructions to install these below.

Windows

Option 1: Windows subsystem for Linux (Windows 10 only)

Make sure to install the Windows Subsystem for Linux.
If you haven't installed it yet, you can follow Microsoft's guide. For installation instructions, refer to the instructions for Linux for the respective distribution.

Option 2: MSYS2

Install MSYS2.
In an MSYS2 shell, run:

pacman -S make cmake git bison flex mingw-w64-x86_64-gcc mingw-w64-x86_64-llvm mingw-w64-x86_64-clang mingw-w64-x86_64-lld

You'll need to use the MSYS MinGW 64-Bit shell when compiling the library or nxdk-powered applications.
If you want to execute a command within a command line or PowerShell window, use the following command:

C:\msys64\msys2_shell.cmd -no-start -here -defterm -mingw64 -c <command>

Make sure to replace C:\msys64\ with the location of your MSYS2 installation, and <command> with the command you want to run, i.e make.
Note that multiple arguments require you to put the entire command you're putting in place of <command> in quotation marks.

macOS

You can install the prerequisites with Homebrew, this should do the job (Xcode ships with make, bison and flex):

brew install cmake coreutils lld llvm

Linux

Ubuntu

apt install build-essential cmake flex bison clang lld git llvm

Note: On older versions of Ubuntu, you may need to install lld via a LLVM nightly package instead.
Note: On Ubuntu, LLVM 6 will not provide llvm-lib correctly. See https://github.com/XboxDev/nxdk/issues/196 for solutions.

Debian

apt install build-essential cmake flex bison clang llvm lld git

openSUSE

zypper install make cmake clang bison flex lld git llvm-devel

Alpine

apk add build-base cmake clang bison flex lld git llvm 

Arch Linux

pacman -Syu --needed make cmake clang bison flex llvm lld git

Remember that, for Unix-based systems, you usually need root (or equivalent) permissions to install packages; either log in as root or use utilities like sudo.

Next

Continue here