release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide
translations



Search | Go
Wiki > Main > RockboxDevelopment > Windows10CrossCompiler

Building a cross compiler on Windows 10

Compiling Rockbox on Windows 10 is a lot easier using the new linux subsystem than using a VM or cygwin.

Setup Ubuntu environment in Windows 10/11

Install Windows Subsystem for Unix

Bring up a command line and type: wsl --install

This will automatically install Ubuntu. Reboot your computer to complete the WSL install. On reboot the Ubuntu console should start and prompt you to make a username and password.

More info: https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10

Install build dependencies

From the Ubuntu console, type:

sudo apt-get update

sudo apt-get install git build-essential texinfo bison libtool autoconf flex zip libtool-bin libgmp3-dev

Checkout the rockbox source

git clone git://git.rockbox.org/rockbox

This will create a local checkout of rockbox on your Windows hard drive. We'll access it later to get binaries.

Build the cross compiler

After the above command, navigate to the rockbox folder you just checked out (cd rockbox). Then type:

cd rockbox

sudo tools/rockboxdev.sh

Type the password you selected and then choose which compilers you want (probably ARM). MIPS does not currently build under Windows.

This will run for 2-10 minutes depending on how fast your computer is. Disabling Windows defender will speed up compiling if you are impatient.

Find Rockbox folder

At this point you have the dev tools setup and you can compile rockbox like on any other platform. However, once built, your binaries will appear under:

\\wsl.localhost\Ubuntu\home

-- MichaelGiacomelli - 25 Jul 2024

Build Simulator for Windows

To build the simulator as stand-alone Windows application, you have to install MinGW (windows cross compiler), and compile the SDL library from source. (Note: Installing the SDL 1.2 developement library from your distro should work, but will not allow statical linking, i.e. you always need the SDL.dll file aside your simulator.exe.)

Step-by-step instructions:

32 bit build (Strongly recommended)

  • prepare the 32 bit SDL compile: ./configure --host=i686-w64-mingw32

64 bit build

  • prepare the 64 bit SDL compile: ./configure --host=x86_64-w64-mingw32

Both

  • when ready, compile: make
  • introduce it to your system: sudo make install
  • help rockbox finding sdl-config: sudo ln -s /usr/local/cross-tools/i386-mingw32/bin/sdl-config /usr/bin/i686-w64-mingw32-sdl-config

Now you can compile the simulator:
  • enter your build directory and run somewhere/rockbox/configure
  • select platform, enter "A" (advanced), enter S (sim) and enter "W" (32 bit)/"6" (Win64 cross-compile)
  • make it!

r8 - 26 Jul 2024 - 01:59:19 - MichaelGiacomelli

Copyright © by the contributing authors.