Building

    If you just want to use the latest Release version of Cutter, please notethat we provide pre-compiled binaries for Windows, Linux and macOS onour

    On Linux, you will need:

    • build-essential
    • git
    • cmake
    • meson
    • libzip-dev
    • libzlib-dev
    • qt5-svg
    • pkgconf

    On Debian-based Linux distributions, all of these packages can be installed with this single command:

    On Arch-based Linux distributions, build-essential should be replaced by base-devel:

    1. sudo pacman -Syu git base-devel cmake meson qt5-base qt5-svg

    Building steps

    The official way to build Cutter on Linux is by using CMake.First, clone the repository with its dependencies:

    1. git clone --recurse-submodules https://github.com/radareorg/cutter

    Then invoke CMake to build Cutter and its dependency radare2.

    1. cd cutter/src
    2. mkdir build
    3. cmake -B build -DCUTTER_USE_BUNDLED_RADARE2=ON
    4. cmake --build build

    If you are interested in building Cutter with support for Python plugins,Syntax Highlighting, Crash Reporting and more,please look at the full list of CMake Building Options.

    After the build process is complete, you should be provided with Cutter executablethat you can start like this:

    1. ./build/Cutter

    Building on Windows

    Cutter works on Windows starting from Windows 7 up to Windows 10.To compile Cutter it is necessary to have installed:

    • A version of Visual Studio (2015, 2017 and 2019 are supported)
    • CMake
    • Qt

    Default way

    To build Cutter on Windows machines using CMake,you will have to make sure that the executables are availablein your %PATH% environment variable.

    Click and select your version of Visual Studio from the list,for example Visual Studio 14 2015.After configuration is done, click Generate and you can openCutter.sln to compile the code as usual.

    There is another way to compile Cutter on Windows, if the one above doesnot work or does not suit your needs.

    Additional requirements:

    • Ninja build system
    • Meson build system

    Download and unpack to the Cuttersource root directory.

    Note that in the below steps, the paths may vary depending on your version of Qt and Visual Studio.

    Environment settings (example for x64 version):

    1. :: Export MSVC variables
    2. CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
    3. :: Add qmake to PATH
    4. SET "PATH=C:\Qt\5.10.1\msvc2015_64\bin;%PATH%"
    5. :: Add Python to PATH
    6. SET "PATH=C:\Program Files\Python36;%PATH%"

    Install Meson:

      To compile Cutter, run:

      1. CALL prepare_r2.bat
      2. CALL build.bat

      Using QtCreator

      One standard way is to simply load the project inside QtCreator.To do so, open QtCreator and on the welcome screen click on “Open Project”,and finally select the cutter/src/Cutter.pro file.QtCreator will then allow you to directly edit the source code and build the project.

      Note

      The easiest way, but not the one we recommend, is to simply run from the root directory,and let the magic happen. The script will use qmake to build Cutter.The build.sh script is meant to be deprecated and will be deleted in the future.

      If you want to manually use qmake, follow these steps:

      1. mkdir build; cd build
      2. qmake ../src/Cutter.pro
      3. make
      4. cd ..

      Additional steps for macOS

      On macOS you will also have to copy the launcher bash script:


      CMake Building Options

      Note that there are some major building options available:

      • CUTTER_USE_BUNDLED_RADARE2 automatically compile Radare2 from submodule.
      • CUTTER_ENABLE_PYTHON compile with Python support.
      • CUTTER_ENABLE_PYTHON_BINDINGS automatically generate Python Bindings with Shiboken2, required for Python plugins!
      • use KSyntaxHighlighting for code highlighting.
      • CUTTER_ENABLE_GRAPHVIZ enable Graphviz for graph layouts.
      • CUTTER_ENABLE_CRASH_REPORTS is used to compile Cutter with crash handling system enabled (Breakpad).

      These options can be enabled or disabled from the command line arguments passed to CMake.For example, in order to build Cutter with support for Python plugins, you can run this command:

      1. cmake -B build -DCUTTER_ENABLE_PYTHON=ON -DCUTTER_ENABLE_PYTHON_BINDINGS=ON

      Or if one wants to explicitely disable an option:

      1. cmake -B build -DCUTTER_ENABLE_PYTHON=OFF

      If you want to build Cutter with crash handling system, you will want to first prepare Breakpad.For this, simply run one of the scripts (according to your OS) from root Cutter directory:

      1. source scripts/prepare_breakpad_linux.sh # Linux
      2. source scripts/prepare_breakpad_macos.sh # MacOS
      3. scripts/prepare_breakpad.bat # Windows

      Then if you are building on Linux you want to change PKG_CONFIG_PATH environment variableso it contains $CUSTOM_BREAKPAD_PREFIX/lib/pkgconfig. For this simply run

      1. export PKG_CONFIG_PATH="$CUSTOM_BREAKPAD_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"

      Troubleshooting

      • Cmake can’t find Qt

      Depending on how Qt installed (Distribution packages or using the Qtinstaller application), CMake may not be able to find it by itself if itis not in a common place. If that is the case, double check that thecorrect Qt version is installed. Locate its prefix (a directorycontaining bin/, lib/, include/, etc.) and specify it to CMake using in the above process, e.g.:

      • R2 libr_*.so cannot be found when running Cutter

      The exact r2 .so file that cannot be found may vary. On some systems, the linker by default uses RUNPATH instead of RPATH which is incompatible with the way r2 is currently compiled. It results in some of the r2 libraries not being found when running cutter. You can verify if this is the problem by running ldd ./Cutter. If all the r2 libraries are missing you have a different problem.The workaround is to either add the –disable-new-dtags linker flag when compiling Cutter or add the r2 installation path to LD_LIBRARY_PATH environment variable.