VeraCrypt

Documentation >> Compiling Gudineline for Linux

This guide describes how to set up a Linux System that can compile the VeraCrypt. Further it is described how VeraCrypt is going to be compiled.
The procedure for a Ubuntu 22.04 LTS system is described here as an example, but the procedure for other Linux systems is analogous.


The following components are required for compiling VeraCrypt:
  1. GNU Make
  2. GNU C++ Compiler 4.0
  3. YASM 1.3.0
  4. pkg-config
  5. wxWidgets 3.2 shared library and header files installed or wxWidgets 3.0 library source code
  6. FUSE library and header files
If you do not want to perform the single steps below, you can run these commands to build an environment and to compile VeraCrpyt:
Download as script: Script
sudo apt update
sudo apt install -y build-essential yasm pkg-config libgtk-3-dev
wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.0/wxWidgets-3.2.0.tar.bz2
tar -xf wxWidgets-3.2.0.tar.bz2
cd wxWidgets-3.2.0
mkdir gtk-build
cd gtk-build
../configure
make
sudo make install
sudo ldconfig
cd ../..
rm -r wxWidgets-3.2.0
rm wxWidgets-3.2.0.tar.bz2
sudo apt install -y libfuse-dev git
git clone https://github.com/veracrypt/VeraCrypt.git cd ~/VeraCrypt/src
make
Installation of GNU Make Installation of GNU Make

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install build-essential

Installation of GNU C++ Compiler 4.0 Installation of GNU C++ Compiler 4.0

If the build-essential were already installed in the step before, this step can be skipped.

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install build-essential

Installation of YASM Installation of YASM

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install yasm

Installation of pkg-config Installation of pkg-config

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install pkg-config

Installation of wxWidgets 3.2 Installation of wxWidgets 3.2

  1. Open a terminal
  2. Execute the following commands:
    sudo apt install libgtk-3-dev
    wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.0/wxWidgets-3.2.0.tar.bz2
    tar -xf wxWidgets-3.2.0.tar.bz2
    cd wxWidgets-3.2.0
    mkdir gtk-build
    cd gtk-build
    ../configure
    make
    sudo make install
    sudo ldconfig
    cd ../..
    rm -r wxWidgets-3.2.0

Installation of libfuse Installation of libfuse

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install libfuse-dev

Download VeraCrypt Download VeraCrypt

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install git
    git clone https://github.com/veracrypt/VeraCrypt.git

Compile VeraCrypt Compile VeraCrypt

Remarks:

  • If you have not installed wxWidgets like described here, you may have to modify the make statement to reference to the right file:
    make WXSTATIC=1
  • By default, a universal executable supporting both graphical and text user interface (through the switch --text) is built.
    On Linux, a console-only executable, which requires no GUI library, can be built using the 'NOGUI' parameter:
    make NOGUI=1 WXSTATIC=1 WX_ROOT=/usr/src/wxWidgets wxbuild
    make NOGUI=1 WXSTATIC=1
Steps:
  1. Open a terminal
  2. Execute the following commands:
    cd ~/VeraCrypt/src
    make
  3. If successful, the VeraCrypt executable should be located in the directory 'Main'.