Skip to content

Development

Alexander Koblov edited this page Jul 29, 2023 · 15 revisions

Table of Contents

Required tools

Double Commander is developed with Free Pascal and Lazarus.

Free Pascal Compiler

It is always preferred to use latest FPC release to build Double Commander.

Current development version requires at least FPC 3.2.2.

Lazarus

Each Double Commander release is usually built with latest stable version of Lazarus.

Current development version requires Lazarus 2.2.6 (3.0 under macOS) or later.

We tend to use latest development version of Lazarus from Git so that any regressions that affect Double Commander can be discovered, reported and fixed before next stable Lazarus release and to adapt earlier to any changes in Lazarus. This way you also keep up-to-date with latest bug fixes in Lazarus.

Required libraries

Linux

To build Double Commander on Linux you need to have development versions of a few libraries installed (libxxx-dev packages). If you get linking errors make sure you have all needed libraries. The following is the list of direct dependencies (packages names are from Debian/Ubuntu). If you use a package manager in your Linux distribution it should pull all of the indirect dependencies for you.

 libdbus-1-dev
 libglib2.0-dev
 libx11-dev
 libgtk2.0-dev      (only GTK2)
 libqt4pas-dev      (only Qt4)
 libqt5pas-dev      (only Qt5)

If you don't have libQt4Pas in your distribution you can download it from FPC Qt4 Binding page. Then you'll also need these dependencies:

 libqt4-network
 libqt4-webkit
 libqtcore4
 libqtgui4

If you don't have libQt5Pas in your distribution you can download it from here. Double Commander requires at least Qt 5.6.0. Then you'll also need these dependencies:

 qt5-qmake
 qt5-default
 qtbase5-dev
 libqt5x11extras5-dev

Getting the source code

Double Commander's source code is stored in a Git repository on GitHub.

To download the current development version use the following command:

 git clone https://github.com/doublecmd/doublecmd.git doublecmd

Building from source

Using Lazarus IDE

If you want to use Lazarus IDE to develop Double Commander, first you have to install a few additional components all of which reside in components directory of DC sources. You must open each .lpk package file:

 chsdet/chsdet.lpk
 CmdLine/cmdbox.lpk (doublecmd < 1.1)
 multithreadprocs/multithreadprocslaz.lpk
 dcpcrypt/dcpcrypt.lpk
 doublecmd/doublecmd_common.lpk
 Image32/Image32.lpk (doublecmd >= 1.1)
 KASToolBar/kascomp.lpk
 gifanim/pkg_gifanim.lpk
 synunihighlighter/synuni.lpk
 viewer/viewerpackage.lpk
 virtualterminal/virtualterminal.lpk (doublecmd >= 1.1)

and install it into Lazarus (menu: Package -> Open package file (.lpk) -> Browse to needed .lpk file -> Press "Install", if "Install" disabled then press "Compile" instead). Choose "No" when asked for rebuilding Lazarus after each package then rebuild Lazarus when you have installed all of them.

After rebuilding Lazarus open the project file src/doublecmd.lpi.

From command line (Windows)

Use build.bat script to build DC on Windows.

First you need the lazbuild utility of Lazarus to be somewhere in your PATH or you need to have an environment variable LAZARUS_HOME pointing to it (e.g. set LAZARUS_HOME=d:\path\to\my\Lazarus).

Execute the script to start the build process. Make sure you use release parameter if you're building for the first time, so that also components and plugins are built:

 > build.bat release

or alternatively without plugins

 > build.bat components
 > build.bat doublecmd

From command line (Linux, FreeBSD, macOS)

Use build.sh script to build DC on Linux, FreeBSD or macOS.

First you need the lazbuild utility of Lazarus to be somewhere in your PATH and if you installed a Lazarus package it should already be there. Otherwise you need to edit the build script and change the lazbuild variable to point to it.

On Linux three widgetsets are supported: GTK2, Qt4 and Qt5. You can choose one by setting lcl environment variable before executing the script to either gtk2 or qt or qt5, for example:

 $ lcl=qt5 ./build.sh release

Execute the script to start the build process. Make sure you use release parameter if you're building for the first time, so that also components and plugins are built:

 $ ./build.sh release

or alternatively without plugins

 $ ./build.sh components
 $ ./build.sh doublecmd

Supported platforms/operating systems

Double Commander supports several platforms and operating systems. See Supported platforms page for a complete list.

Known issues with FPC, Lazarus

There are sometimes issues in Double Commander which come from bugs in FPC or Lazarus. Some of them may affect development, debugging, etc. Check the Issues with FPC, Lazarus page for the list of currently known bugs.

Guidelines for developers

If you intend to write code for Double Commander please check the Guidelines for developers page for pointers, hints, etc., so that you are consistent with other developers.

How to help in development

Currently there is no specific goals list, but some ways you can help:

  • Test and report bugs. Most important are crashes that can be reproduced or that generate a backtrace in doublecmd.err file. There are sometimes bugs only exhibited on x86_64 but not on i386 and since we don't have much access to x86_64 they usually are not caught. See Making a bug report page for guidelines on how to make a good bug report.
  • Look at the bugtracker for bugs you could fix or help fixing. Especially looking for fixing bugs on x86_64-Linux, Windows Vista, 7 64-bit, MacOSX.
  • If you want to translate Double Commander to your language check the Translation page.
  • If you have ideas for new features or changing existing features head to our forum to discuss them.