Compiling DC++ in new format

It’s been a while since last release of DC++. What has been going on since? Well, a lot of changes are done, and this means that the compiling process changed too.

First of all, Microsoft’s Visual C++ is no longer required for the compile process. Instead of it, MinGW is used. MinGW stands for Minimalist Gnu for Windows, and it’s the gcc ( and g++ ) compiler, moved to Windows.

To install mingw, download from their site the following packages in tar.gz format ( not the sources ) w32api, binutils, mingw-runtime, gcc-core and gcc-g++. You need the 4.2+ version of gcc ( still appears as a technology preview ).

There are 2 variants of gcc, dw2 and sjlj, it is possible to work with the sjlj variant, but I used dw2 and it worked fine. Untar all those in a folder named MinGW by example, go to MinGW/bin and copy gcc-dw2.exe to gcc.exe and g++-dw2.exe to g++.exe . Now, add the MinGW/bin to your path.

Install SCons; and add it to your path ( SCons requires Python, so you will need to install that first).

Download HTML help workshop . Copy the include and library files to the respective directories in the htmlhelp folder. Make sure hhc.exe is in your PATH.

The installation of STLport is the main problem I faced while trying to compile. First, install CygWin. After that, get STLport ( version 5.1.3 , latest at this time ). Unzip the stlport to stlport folder in the DC++ source. Now, run cygwin, and browse to stlport/build/lib.

Now, type : make -f gcc.mak After it’s finished, type also

make -f gcc.mak install

make -f gcc.mak install-release-static
make -f gcc.mak install-dbg-static
make -f gcc.mak install-stldbg-static

Last three are required so that DC++ will run stand-alone ( with no required dlls).

Now, open a command prompt and run scons. Following options are available :

“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

I used scons tools=mingw mode=release

If you get some error about uPnP or something like that, you need to get natupnp.h; and paste it to MinGW/include folder.

If some other references errors show up, try running scons again.

Don’t worry if lots of warnings appear ( they don’t stop the compiling process, and they will be fixed in near future ).

Don’t get scared if the .exe is a bit large ( it contains redundant symbols ). The exe will be optimised into smaller size ( I got 88 MB exe, and after optimization it should get below 8 MB )

7 Responses to Compiling DC++ in new format

  1. Adrian Moş says:

    Just a quick question on the issue: What version of STLPort is to be used with the “new DC++” ?

    I’ve successfully compiled DC++ on numerous occasions before, but for the current SVN, it has been quite beyond me to figure out what the problem is. It seems to behave just like older DC++ versions, when the STLPort version was too old, new or modified… like “error C2653: ‘StringMap’ : is not a class or namespace name”, or “error C2039: ‘unordered_set’ : is not a member of ‘stlp_std::tr1′”, etc…

  2. mikejj says:

    I currently use 5.1.2. Will try 5.1.3 when i figure out where the “make” command i had installed has disappeared too.

  3. pietry says:

    As I said, “After that, get STLport ( version 5.1.3 , latest at this time )”. Use 5.1.3. If you use another version, you will get a #error directive that stops compiling ( you can remove it and try with other STLport version at your own risk ). The old DC++ uses STLport 4.xx I think.
    Those errors are indeed from stl namespace.

  4. mikejj says:

    Btw, you can compile STLPort with mingw32-make using the Current release of Mingw gcc and g++, before upgrading them to the candidate version needed for compiling DC++. :)

  5. pietry says:

    I know, but I compiled with cygwin and it was the only way I tested.

  6. Adrian Moş says:

    Strange… it doesn’t matter which STLPort version I use… the same errors appear.

    Two questions:
    1. (obviously) is there anything special I have to do after building STLport?
    2. Why is it so difficult to supply source code that has all dependencies there? In other words, why isn’t STLport included in the package as well, in a compiled/header form, just as it’s supposed to be, since the DC++ coders have to both use it and update it anyway?

  7. pietry says:

    1. If you build it with all the 5 commands, it should be ok
    2. Because arne is too lazy to make a scons script for building stlport ( that will also increase the src size and compile time and so on )
    Use stlport 5.1.3. Did you run all those commands when building stlport ? try cleaning the svn and rebuild

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: