To compile Qbittorrent 3.0.2 with QT4.8.2, boost 1.51, libtorrent 0.16.3 or with lastest libtorrent svn and without zlib support.
==================================
(Im not a programmer, I tried to compile this just for fun.)
Compilation Steps with msvc 10.0 compiler
We are building qBittorrent on Windows with msvc compiler instead of
MinGW. This choice was made because MinGW does not support wide
characters <http://www.mingw.org/wiki/wide_characters>. Msvc compiler
also generates smaller executables than MinGW.
*
•.Download and install Visual C++ 2010 Express
<http://www.microsoft.com/visualstudio/e ... pp-express>
*
•.Download and install Qt binaries compiled with msvc
<http://qt.nokia.com/downloads/windows-cpp-vs2010> (not compiled
with MinGW)
*
•.Add Msvc and Qt bin/ folders (C:\Qt\4.8.2\bin and C:\Program
Files\Microsoft Visual Studio 10.0\VC\bin) to the PATH environment
variable.
(For example using windows 7: http://www.itechtalk.com/thread3595.html)
*
•.Create new folder for download and extract sources. For example:
D:\QBT_Project
*
•.Download Boost Jam
<http://sourceforge.net/projects/boost/f ... p/download>
32bits for 1.51 boost library (bjam) and Boost library
<http://sourceforge.net/projects/boost/f ... p/download>
1.51 and unzip them in D:\QBT_Project\
You will got 2 new directories:
D:\QBT_Project\bin
and
D:\QBT_Project\boost_1_51_0
*
•.Compile boost using the following command in a terminal:
[ (bjam must be in the PATH):
(For example using windows 7: http://www.itechtalk.com/thread3595.html)
Edit PATH environment variable and ADD a point to bjam.exe
directory (you will need to close and reopen your terminal window
after that)
PATH = DONT CHANGE THE PREVIOUS ONE SIMPLE ADD THE
FOLLOWING;D:\QBT_Project\bin
]
Open “Visual Studio Command Prompt”:
Type:
D: (Press Enter)
cd D:\QBT_Project\boost_1_51_0 (Press Enter)
Copy the following command in the “Visual Studio Command Prompt” and
press Enter:
bjam -q --with-filesystem --with-thread --toolset=msvc
variant=release link=static runtime-link=shared
*
•.Define BOOST_ROOT environment variable and point to the boost
source folder (you will need to close and reopen your terminal
window after that)
(For example using windows 7: http://www.itechtalk.com/thread3595.html)
BOOST_ROOT = D:\QBT_Project\boost_1_51_0
*
•.Download lastest stable & recomended OpenSSL 32 bits
<http://slproweb.com/download/Win32OpenSSL-1_0_1c.exe> and install it
(Default: C:\OpenSSL-Win32 )
*
•.Copy OpenSSL include folder (C:\OpenSSL-Win32\include\openssl) to
Msvc include/ folder (C:\Program Files\Microsoft Visual Studio
10.0\VC\include)
*
•.Download libtorrent 0.16.3
<http://code.google.com/p/libtorrent/dow ... 6.3.tar.gz>
and extract it (v0.14.10-v0.16.0svn are known to work)
(Or you can try lastest Svn:
http://libtorrent.svn.sourceforge.net/v ... ent/trunk/?
<http://libtorrent.svn.sourceforge.net/v ... r>view=tar
<http://libtorrent.svn.sourceforge.net/v ... /?view=tar>
)
*
•.Compile libtorrent using the following command in a terminal:
Open “Visual Studio Command Prompt”:
Type:
D: (Press Enter)
cd D:\QBT_Project\libtorrent-rasterbar-0.16.3(Press Enter)
Copy the following command in the “Visual Studio Command Prompt” and
press Enter:
bjam -q --without-python --toolset=msvc variant=release link=static
runtime-link=shared logging=none geoip=static encryption=openssl
dht-support=on boost=source define="BOOST_FILESYSTEM_VERSION=2"
*
•.Download a recent qBittorrent
o
•.GIT respository is located at
git://github.com/cdumez/qBittorrent.git
o
•.Tarballs are available from sourceforge here
<http://sourceforge.net/projects/qbittor ... z/download>
(3.0.2)
Download http://geolite.maxmind.com/download/geo ... oIP.dat.gz and extrac it (GeoIP.dat) in:
D:\QBT_Project\qbittorrent-3.0.2\src\geoip
*
•.Download and install Qt Creator IDE 2.5.2 for Windows
<http://get.qt.nokia.com/qtcreator/qt-cr ... -2.5.2.exe>
o
•.Configure Qt Creator to use Qt-msvc x86:
Tools-->Options-->Build & Run-->QT versions should be QT 4.8.2
qmake.exe
Tools-->Options-->Build & Run-->Toolchains should be there MSVC
10.0 x86
*
•.Start QtCreator IDE and load qBittorrent project file
(qbittorrent.pro) in D:\QBT_Project\qbittorrent-3.0.2\
* Make sure that in Projects--->Build settings--->Is in "Released Mode"
•.Edit winconf.pri to point to the correct include and lib paths on
your file system (boost, libtorrent, OpenSSL)
o
•.boost libs are generated in
D:\QBT_Project\boost_1_51_0\stage\lib
o
•.libtorrent lib is generated in
D:\QBT_Project\libtorrent-rasterbar-0.16.3\bin\msvc-10.0\release\boost-source\encryption-openssl\geoip-static\link-static\threading-multi\
o
•.OpenSSL libs are located at C:\OpenSSL-Win32\lib\VC as a default
•.Build qBittorrent using QtCreator, it should compile fine!
( Build---->Rebuild All )
qbittorrent.exe should be located in:
D:\QBT_Project\qbittorrent-build-desktop-Qt_4_8_2_in_PATH__4_8_2__Release\src\release
Last edited Sep 10, 2012
Regards.
My Little Modifications to the Windows Compilation WIKI:
My Little Modifications to the Windows Compilation WIKI:
Last edited by djal on Mon Sep 10, 2012 3:02 am, edited 1 time in total.
Re: My Little Modifications to the Windows Compilation WIKI:
my winconf.pri:
My winconf-msvc.pri
Code: Select all
# Adapt these paths on Windows
#Point this to the boost include folder
INCLUDEPATH += $$quote(D:/Qbit_source/qbittorrent-3.0.2/qbittorrent-3.0.2/boost_1_51_0)
#Point this to the libtorrent include folser
INCLUDEPATH += $$quote(D:/Qbit_source/qbittorrent-3.0.2/qbittorrent-3.0.2/libtorrent-rasterbar-0.16.3/include)
#Point this to the zlib include folder(libtorrent's if you used that)
###INCLUDEPATH += $$quote(D:/Qbit_source/zlib127/zlib-1.2.7)
#Point this to the openssl include folder
INCLUDEPATH += $$quote(C:/OpenSSL-Win32/include)
#Point this to the openssl lib folder
LIBS += $$quote(-LC:/OpenSSL-Win32/lib/VC)
#Point this to the libtorrent lib folder
LIBS += $$quote(-LD:/Qbit_source/qbittorrent-3.0.2/qbittorrent-3.0.2/libtorrent-rasterbar-0.16.3/bin/msvc-10.0/release/boost-source/encryption-openssl/geoip-static/link-static/threading-multi)
#Point this to the boost lib folder
LIBS += $$quote(-LD:/Qbit_source/qbittorrent-3.0.2/qbittorrent-3.0.2/boost_1_51_0/stage/lib)
##
###LIBS += $$quote(-LC:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib)
###LIBS += $$quote(-LC:/OpenSSL-Win32/lib/)
# LIBTORRENT DEFINES
##DEFINES += BOOST_ASIO_SEPARATE_COMPILATION
DEFINES += BOOST_ASIO_DYN_LINK
DEFINES += BOOST_ALL_NO_LIB
DEFINES += BOOST_ASIO_HASH_MAP_BUCKETS=1021
DEFINES += BOOST_EXCEPTION_DISABLE
DEFINES += BOOST_SYSTEM_STATIC_LINK=1
DEFINES += BOOST_THREAD_USE_LIB
DEFINES += BOOST_THREAD_USE_LIB=1
DEFINES += TORRENT_USE_OPENSSL
DEFINES += UNICODE
DEFINES += WIN32
DEFINES += WIN32_LEAN_AND_MEAN
DEFINES += _CRT_SECURE_NO_DEPRECATE
DEFINES += _FILE_OFFSET_BITS=64
DEFINES += _SCL_SECURE_NO_DEPRECATE
DEFINES += _UNICODE
DEFINES += _WIN32
DEFINES += _WIN32_WINNT=0x0500
DEFINES += _WIN32_IE=0x0500
DEFINES += __USE_W32_SOCKETS
DEFINES += WITH_SHIPPED_GEOIP_H
CONFIG(debug, debug|release) {
DEFINES += TORRENT_DEBUG
} else {
DEFINES += NDEBUG
}
include(winconf-msvc.pri)
DEFINES += WITH_GEOIP_EMBEDDED
message("On Windows, GeoIP database must be embedded.")
RC_FILE = qbittorrent.rc
# Enable Wide characters
DEFINES += TORRENT_USE_WPATH
#Adapt the lib names/versions accordingly
LIBS += libtorrent.lib \
libboost_system-vc100-mt-1_51.lib \
libboost_filesystem-vc100-mt-1_51.lib \
libboost_thread-vc100-mt-1_51.lib
LIBS += advapi32.lib shell32.lib
LIBS += libeay32MD.lib ssleay32MD.lib
LIBS += powrprof.lib
Last edited by djal on Mon Sep 10, 2012 2:42 am, edited 1 time in total.
Re: My Little Modifications to the Windows Compilation WIKI:
Well, I hadnt compile for x64 but maybe someone could find it helpfull.
===========
To Crosscompile or generate 64 bits code with a 32 bits system:
Add to bjam the option: address-model=64
===========
To Compile Qbittorrent x64:
*Compile QT4.8.2 or you can try it with this:
https://code.google.com/p/qt-msvc-installer/
*bjam.exe for 64 bits systems:
http://sourceforge.net/projects/boost/f ... p/download
*Install OpenSSL x64:
http://slproweb.com/download/Win64OpenSSL-1_0_1c.exe
* •.Configure Qt Creator to use Qt-msvc x64
Tools-->Options-->Build & Run-->Toolchains should be there MSVC
10.0 x64
*In winconf.pri:
# Adapt these paths on Windows to Point this to the x64 libs
*In winconf-msvc.pri:
# #Adapt the lib names/versions accordingly
Hopefully I dont forget anything
Regards
===========
To Crosscompile or generate 64 bits code with a 32 bits system:
Add to bjam the option: address-model=64
===========
To Compile Qbittorrent x64:
*Compile QT4.8.2 or you can try it with this:
https://code.google.com/p/qt-msvc-installer/
*bjam.exe for 64 bits systems:
http://sourceforge.net/projects/boost/f ... p/download
*Install OpenSSL x64:
http://slproweb.com/download/Win64OpenSSL-1_0_1c.exe
* •.Configure Qt Creator to use Qt-msvc x64
Tools-->Options-->Build & Run-->Toolchains should be there MSVC
10.0 x64
*In winconf.pri:
# Adapt these paths on Windows to Point this to the x64 libs
*In winconf-msvc.pri:
# #Adapt the lib names/versions accordingly
Hopefully I dont forget anything

Regards
Last edited by djal on Mon Sep 10, 2012 4:17 am, edited 1 time in total.
Re: My Little Modifications to the Windows Compilation WIKI:
[quote="djal"]
We are building qBittorrent on Windows with msvc compiler instead of
MinGW. This choice was made because MinGW does not support wide
characters <http://www.mingw.org/wiki/wide_characters>. Msvc compiler
also generates smaller executables than MinGW.
[/quote]
Actually this doesn't really matter since we're building on top of Qt and Boost, which support unicode regardless of the compiler.
I did build qBt with mingw64; works well, but requires poking around libtorrent code - mostly missing includes and __MINGW64__ ifdefs.
Regrading size: this has always been this way. -Os might be a better choice when using gcc; also -flto and -fuse-linker-plugin (/GL and /LTCG analogs of MSVC) are still bugged on windows.
[quote="djal"]
Well, I hadnt compile for x64 but maybe someone could find it helpfull.
[/quote]
There's a guide available: http://qbforums.shiki.hu/index.php?topic=855.0
We are building qBittorrent on Windows with msvc compiler instead of
MinGW. This choice was made because MinGW does not support wide
characters <http://www.mingw.org/wiki/wide_characters>. Msvc compiler
also generates smaller executables than MinGW.
[/quote]
Actually this doesn't really matter since we're building on top of Qt and Boost, which support unicode regardless of the compiler.
I did build qBt with mingw64; works well, but requires poking around libtorrent code - mostly missing includes and __MINGW64__ ifdefs.
Regrading size: this has always been this way. -Os might be a better choice when using gcc; also -flto and -fuse-linker-plugin (/GL and /LTCG analogs of MSVC) are still bugged on windows.
[quote="djal"]
Well, I hadnt compile for x64 but maybe someone could find it helpfull.
[/quote]
There's a guide available: http://qbforums.shiki.hu/index.php?topic=855.0
Re: My Little Modifications to the Windows Compilation WIKI:
Do not use prebuilt OpenSSL binaries; they require the MSVC 2008 runtime. Just build it yourself, it's very easy.
Someone should modify/update and apply this patch; it's bad not having the Version shown. http://pastebin.com/7PbEaaUW
Lastly, someone should commit an installer script so that all the builders use it. Otherwise NSIS/Inno Setup installers are not compatible causing all kinds of problems.
As for MinGW, it would be very nice if someone included the needed patches in the repo. /GL /LTCG works perfectly fine here. -flto on the other almost never works right for me but I didn't try it with GCC 4.7.1 I use. Last time I tried it was with 4.7.0.
Someone should modify/update and apply this patch; it's bad not having the Version shown. http://pastebin.com/7PbEaaUW
Lastly, someone should commit an installer script so that all the builders use it. Otherwise NSIS/Inno Setup installers are not compatible causing all kinds of problems.
As for MinGW, it would be very nice if someone included the needed patches in the repo. /GL /LTCG works perfectly fine here. -flto on the other almost never works right for me but I didn't try it with GCC 4.7.1 I use. Last time I tried it was with 4.7.0.
Last edited by Chem456 on Wed Sep 12, 2012 12:02 pm, edited 1 time in total.
Re: My Little Modifications to the Windows Compilation WIKI:
Should build fine under mingw32 (unless doing a static build, which is still bugged due to some strange args overflow https://code.google.com/p/libtorrent/is ... =1&q=mingw), mingw64 on the other hand needs some patches.
http://pastebin.com/bTHLMxia
http://pastebin.com/3FGgjXMN
http://pastebin.com/gZ1KzAc5
Last two patches are specific to qBt.
http://pastebin.com/bTHLMxia
http://pastebin.com/3FGgjXMN
http://pastebin.com/gZ1KzAc5
Last two patches are specific to qBt.
Last edited by Dayman on Wed Sep 12, 2012 2:40 pm, edited 1 time in total.
-
- Administrator
- Posts: 2443
- Joined: Sun Jan 23, 2011 1:17 pm
Re: My Little Modifications to the Windows Compilation WIKI:
For anyone caring. If you sign up on Github you can edit/add any info in the wiki. I am currently updating the instructions on how to build on Windows.