Compiling DC++ in new format
September 4, 2007 7 Comments
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.
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 )