Skip to content

Latest commit

 

History

History
106 lines (61 loc) · 2.85 KB

BUILD_INSTRUCTIONS.md

File metadata and controls

106 lines (61 loc) · 2.85 KB

Building from source

Visual Studio

The msvc directory contains what is needed to build the project. Read the file msvc/README, which explains how.

You will need to download the library files from Microsoft as indicated. If you don't want to do this, see the alternative in msvc/ucrt.

Cygwin

Run the Cygwin installer, available from https://www.cygwin.com/setup-x86_64.exe. When you get to the package selection page, select "Category" in the list "View" at the top left, and expand the tree by clicking on "All" and "Devel".

Then choose the following packages (you can use the search box to reduce the list), by selecting the version to install in the column "New":

  • make
  • mingw64-i686-binutils
  • mingw64-i686-gcc-core
  • mingw64-x86_64-binutils
  • mingw64-x86_64-gcc-core

Open a Cygwin terminal and run the following commands:

cd /cygdrive/c/Users/$USER/Desktop/superUser 	# (or wherever you put the source to)
make

If successful, the files superUser32.exe and superUser64.exe are created.

MSYS2

If you prefer to use the MSYS2 platform, run the installer following these instructions: https://www.msys2.org
Do NOT install the packages *ucrt* indicated in the "Installation" procedure.

In the MSYS2 UCRT64 terminal, run:

pacman -S make
pacman -S mingw-w64-i686-gcc
pacman -S mingw-w64-x86_64-gcc

Run the following command several times until all the packages are up-to-date: (read the beginning of this page for details: https://www.msys2.org/docs/updating/ )

pacman -Suy

When done, close the MSYS2 UCRT64 terminal.

To build the 64-bit executable, open the MSYS2 MINGW64 terminal and run:

cd /c/Users/$USER/Desktop/superUser 	# (or wherever you put the source to)
make

If successful, the file superUser64.exe is created.

To build the 32-bit executable, open the MSYS2 MINGW32 terminal and run:

cd /c/Users/$USER/Desktop/superUser 	# (or wherever you put the source to)
make

If successful, the file superUser32.exe is created.

It is also possible to use the CLANG32/CLANG64 environments, which have a newer compiler that builds smaller executables (20-25 KB instead of 50-54 KB). To do this, you will need to install the appropriate packages as above (mingw-w64-clang-i686-gcc-compat and mingw-w64-clang-x86_64-gcc-compat). Generated executables require the UCRT dll to run (included in Windows 10 or installed by the cumulative updates in older versions).

Linux

To build on Linux, native executables running on Windows.

Tested on Linux Mint based on Ubuntu.

Install the gcc-mingw-w64 package:

sudo apt install gcc-mingw-w64

Open a terminal and run the following commands:

cd $HOME/Desktop/superUser 	# (or wherever you put the source to)
make

If successful, the files superUser32.exe and superUser64.exe are created.