Language:

Compiling DC++

  1. Application and Dependency versions needed

    Some tools can be found on <http://sourceforge.net/projects/dcplusplus/files/Dev/>,
    although I recommend getting them directly from their hosts.
  2. Specific configuration of the compiler

    1. HTML Help support (only for MinGW)

      To build a version with HTML Help support, copy the following files from a Windows SDK
      (Windows SDK path -> DC++ source code path):
      Include/shared/winapifamily.h -> mingw/include/winapifamily.h
      Include/um/HtmlHelp.h -> mingw/include/htmlhelp.h
      Lib/win8/um/x86/Htmlhelp.Lib -> mingw/lib/htmlhelp.lib
      Lib/win8/um/x64/Htmlhelp.Lib -> mingw/lib/x64/htmlhelp.lib
      The latest Windows SDK is currently at
      <http://msdn.microsoft.com/en-US/windows/desktop/hh852363>; it installs into
      "C:\Program Files (x86)\Windows Kits\8.0".
    2. OpenSSL (only for Visual Studio)

      Download OpenSSL from www.openssl.org and compile it. You should get libraries called
      libeay32.lib and ssleay32.lib; copy them in openssl/lib.
      To compile DC++ in debug mode, OpenSSL libraries have to be compiled in debug mode too
      (read their instructions file; it's a matter of adding "debug" in the do_* file you use).
      Rename debug libraries to libeay32d.lib and ssleay32d.lib; put them in openssl/lib.
      You may also ask around in the DCDev hub; someone might have already built a package.
  3. Starting the build process

    Open a command prompt and type "scons" followed by some options:
    "tools=mingw" - Use mingw for building (default)
    "tools=default" - Use msvc for building (yes, the option value is strange)
    "mode=debug" - Compile a debug build (default)
    "mode=release" - Compile an optimized release build
    "arch=x64" - Compile a 64-bit build
    To see more options, type "scons -h".
    Tip: You can create a file custom.py and put your options in there.
    You can choose which targets to build; eg:
      scons build/debug-mingw/dwt
    will only build DWT with MinGW in debug mode. By default, when no target is specified, SCons builds all targets.
    For more possible arguments, consult the SCons manual.
    If you have problems, use google. It works for me.
  4. Alternative compilers

    1. Various versions of MinGW (GCC 4.8 or later): http://sourceforge.net/projects/mingw-w64/files/ http://sourceforge.net/projects/mingw/files/

      We recommend using compilers from the MinGW-w64 project. All you have to do to use one is
      download it and extract it.
      Prefer DWARF versions (usually marked with a "-dw") of 32-bit compilers; SJLJ ones should
      be avoided for performance reasons.
      I am currently using these 2 packages by the MinGW-w64 project:
      - 64-bit: <http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.8.2/threads-win32/seh/>
      - 32-bit: <http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.8.2/threads-win32/dwarf/>
      To install compilers from regular MinGW (not MinGW-w64), the easiest way is to use
      mingw-get. Extract it to C:\MinGW and run:
              mingw-get install gcc g++
      A graphical installer around mingw-get is also available to facilitate the above.
      Note that building DC++ with MinGW (not MinGW-w64) is not often tested and may lead to
      stability issues.
      Make sure that MinGW\bin is in your PATH environment variable.
      Alternatively, if you have Cygwin, a MinGW compiler can be installed as part of Cygwin:
      select it in the "Devel" category when running the Cygwin installer.
      To make DC++ use it, add "prefix=i686-pc-mingw32-" to the scons arguments or create a
      custom.py file containing:
              prefix='i686-pc-mingw32-'
      Make sure that Cygwin\bin is in your PATH environment variable.
      Note that building with MinGW compilers provided by Cygwin is not often tested.
    2. Microsoft Visual Studio 2013: http://msdn.microsoft.com/en-us/visualc/default.aspx

      Make sure VS is up-to-date; in particular, you will need the Nov 2013 CTP from
      <http://www.microsoft.com/en-us/download/details.aspx?id=41151>. Use the patch in
      msvc/nov2013ctp.patch to patch your VC/vcvarsall.bat file to make use of it (if you
      generate project files and compile from the VS GUI, that won't be necessary).
      To generate project files for MSVC, run "scons" with "msvcproj=1" and "tools=default".
      [Temporary until SCons fully supports VS 2013: the above command has to be run from a VS
      command prompt.]
      The resulting solution file (DCPlusPlus.sln) will be in msvc/[mode-arch]/.
  5. Other information and submitting patches

    1. With doxygen, graphviz and some luck, you can use the supplied doxygen configuration file to generate some nice docs. Just check that the paths in the doxyfile are correct.

    2. In the event you experience crashing you can check the howto guide for debugging at https://answers.launchpad.net/dcplusplus/+faq/337

      Note that DCPlusPlus.exe is stripped by default when it has been built with MinGW;
      debugging symbols instead reside in DCPlusPlus.pdb. To get GDB to swallow it, start it with
      the following command:
              gdb -e DCPlusPlus.exe -s DCPlusPlus.pdb
    3. Linux / Unix:

      Look at <http://launchpad.net/linuxdcpp> for the *nix port of DC++ - they'll gladly accept any help.
    4. Submitting patches

      If you think you've done something that more people could use, you can always submit a
      patch for inclusion in the original distribution. I will then consider whether I like
      the patch or not based on things that might seem to be completely random, which just
      might be the case. Popular reasons for rejecting a patch include, but are not limited
      to, ugly code, abusable features, features that I don't like that bloat the application
      and incompatibility with other modifications I've already done.
      The Mercurial code repository is at <https://sourceforge.net/p/dcplusplus/code/>.
      We accept both plain patches and pull requests.
    5. Licensing issues with submitted patches

      In order to avoid future licensing issues, I ask you to give me copyright over any submitted code.
      If you don't like this policy, you are free to start your own distribution (as
      many have done), and if you're lucky it might become more popular than the original =). Please
      state explicitly when submitting the patch that you give me copyright over the code if the submission is larger
      than trivial.
    6. Developing plugins

      The DC plugin SDK is at <https://launchpad.net/dc-plugin-sdk>.
      See dcpp/Plugin* files for implementation details.
      The "Plugin format (dcext).txt" document describes the way plugins are packaged.