This page describes how to compile qBittorrent using MSVC 2008 under Windows. This is tested under Windows XP sp2 but it should work the same under any other Windows version. Also it should build fine with MSVC 2010 with minor adjustments. Here the Express Edition of MSVC 2008 was used but the full edition must behave the same.
=== What you will need: ===
* The MSVC 2008 compiler. The Express Edition(free) will do fine.
* A [http://www.perl.org/ Perl language] interpreter. [http://strawberryperl.com/ Strawberry Perl] will do fine. Download version 5.16.1.1 [http://strawberry-perl.googlecode.com/files/strawberry-perl-5.16.1.1-32bit.msi here].
* Latest release of the [http://www.nasm.us/ NASM assembler]. Download version 2.10.07 [http://www.nasm.us/pub/nasm/releasebuilds/2.10.07/win32/nasm-2.10.07-win32.zip here].
* Latest release of [http://www.zlib.net/ Zlib]. Download version 1.2.7 [http://zlib.net/zlib-1.2.7.tar.bz2 here].
* Latest release of [http://www.openssl.org/ OpenSSL]. Download version 1.0.1e [https://www.openssl.org/source/openssl-1.0.1e.tar.gz here].
* Latest release of the [http://www.boost.org/ Boost libraries]. Download version 1.53.0 [http://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.7z/download here].
* Latest release of [http://www.rasterbar.com/products/libtorrent/ libtorrent(rasterbar)]. Download version 0.16.9 [https://libtorrent.googlecode.com/files/libtorrent-rasterbar-0.16.9.tar.gz here].
* Latest release of the [http://qt-project.org/ Qt libraries] source. Download version 4.8.4 [http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.4.tar.gz here].
* Latest release of [http://www.qbittorrent.org qBittorrent]. Download version 3.0.9 [http://sourceforge.net/projects/qbittorrent/files/qbittorrent/qbittorrent-3.0.9/qbittorrent-3.0.9.tar.xz/download here].
* Latest release of [http://qt-project.org/downloads#qt-creator Qt Creator]. Download version 2.6.2 [http://releases.qt-project.org/qtcreator/2.6.2/qt-creator-windows-opensource-2.6.2.exe here].
* Navigate to the Boost source folder. If you are still in the MSVC shell just issue (assuming you have only one folder beginning with the letter 'b' in your qBt folder) the command
* Compile a static version of Boost. Issue the following command where N is the number of CPU cores you have or how many threads you want b2 to use when compiling (msvc version is needed for the correct choice of msvc-9.0 if installed msvc-10.0) (replace N with the number of processor cores):
b2 -q --with-system --toolset=msvc-9.0 variant=release link=static runtime-link=static -j N
* (Optional) This is what you can put in a batch file -- e.g. 'mkb.bat' -- to perform the above. Assuming you don't care about how many threads boost will use. You must stay within this command prompt to benefit from the SET command here, when you navigate to the next step.
* Extract the Libtorrent sources in the working dir.
* Open the MSVC2008 command shell. Start->Programs->Microsoft Visual C++ 2008 Express Edition->Visual Studio Tools->Visual Studio 2008 Command Prompt
* Navigate to the Libtorrent source folder. eg ''cd C:\qBittorrent\libtorrent-rasterbar-0.16.3''
* Copy the b2.exe from the Boost directory to the Libtorrent directory
copy ..\boost_1_51_0\b2.exe b2.exe
* Set the BOOST_ROOT environment variable to point to the Boost source directory(absolute path)
set BOOST_ROOT="C:\qBittorrent\boost_1_51_0"
* Compile a static version of Libtorrent. Issue the following command where N is the number of CPU cores you have or how many threads you want b2 to use when compiling:
* If you want to continue with the lazy batch file approach here's the batch file you need to use (still assuming you haven't left the VS2008 Command prompt) -- copy and paste it to e.g. 'mkl.bat' and place it in your lib* folder and then run it:
* Click the '''Add...''' button and select the qmake.exe you just build. It should be in '''C:\qBittorrent\qt-everywhere-opensource-src-4.8.3\bin\qmake.exe'''
* Go to [http://www.maxmind.com Maxmind] and download the GeoLite Country database in binary format. Here is the [http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz link].
* Extract the ''GeoIP.dat'' file inside ''C:\qBittorrent\qbittorrent-3.0.2\src\geoip''.
* Launch Qt Creator and open the ''qbittorrent.pro'' file in ''C:\qBittorrent\qbittorrent-3.0.2''
* From the Window that pops up select the Qt version you added above and specify '''release''' version. Also check the ''Use Shadow Building'' checkbox. You can also select where qBittorrent will be built if you want.
* Open the ''winconf.pri'' file and adjust the paths. Read the comments. '''NOTE:''' Replace any '\' with '/' in the paths to avoid some Qt warnings.
* Open the ''winconf-msvc.pri'' file and adjust the filename of the lib of Boost.
* Select Build->Build All
* After the compilation ends you should have ''qbittorrent.exe'' in ''<build folder>\src\release''. "build folder" is where you chose qBittorrent to be build in the popup window.